1. Learn
  2. /
  3. Courses
  4. /
  5. Foundations of Inference in Python

Exercise

Testing for normality

A powerful suite of statistical tools, which includes several common hypothesis tests, depends on the assumption that the underlying data is normally distributed. While a histogram can hint at whether the data is approximately normally distributed, various hypothesis tests allow us to test this assumption directly. Moreover, histograms can be very sensitive to the number of bins, especially when the sample sizes are small.

In this exercise you'll work with salary data from employees for the City of Austin in salary_df. In particular you will be working with Hispanic firefighters. You'll analyze if their years of employment are approximately normally distributed using the Anderson-Darling hypothesis test.

Instructions

100 XP
  • Plot a histogram showing the Years of Employment for the employees.
  • Conduct an Anderson-Darling test for normality to see if Years of Employment is approximately normally distributed.
  • Find which critical_values the test statistic is greater than.
  • Print the significance_level(s) at which the null hypothesis would be rejected.