# The Chi-Square Distribution

## Goodness-of-Fit Test

In this type of hypothesis test, you determine whether the data fit a particular distribution. For example, you may suspect your unknown data fit a binomial distribution. You use a chi-square test, meaning the distribution for the hypothesis test is chi-square, to determine if there is a fit. The null and the alternative hypotheses for this test may be written in sentences or may be stated as equations or inequalities.
The test statistic for a goodness-of-fit test is:
where
1. O = observed values (data),
2. E = expected values (from theory), and
3. k = the number of different data cells or categories.
The observed values are the data values, and the expected values are the values you would expect to get if the null hypothesis were true. There are n terms of the form 
 .
The number of degrees of freedom is df = (number of categories – 1).
The goodness-of-fit test is almost always right-tailed. If the observed values and the corresponding expected values are not close to each other, then the test statistic can get very large and will be way out in the right tail of the chi-square curve.

### References

College Board. (n.d.). Retrieved from http://www.collegeboard.com
Ma, Y., et al. (2003). Association between eating patterns and obesity in a free-living US adult population. American Journal of Epidemiology 158(1), 8592.
Ogden, C. L., et al. (2012, January). Prevalence of obesity in the United States, 20092010 (NCHS Data Brief No. 82). Hyattsville, MD: National Center for Health Statistics. Retrieved from http://www.cdc.gov/nchs/data/databriefs/db82.pdf
Stevens, B. J. (n.d.). Multi-family and commercial solid waste and recycling survey. Arlington County, VA. Retrieved from http://www.arlingtonva.us/departments/EnvironmentalServices/SW/file84429.pdf
U.S. Census Bureau. (n.d.). Current population reports. Retrieved from https://www.census.gov/main/www/cprs.html
U.S. Census Bureau. (n.d). Retrieved from https://www.census.gov/

### Chapter Review

To assess whether a data set fits a specific distribution, you can apply the goodness-of-fit hypothesis test that uses the chi-square distribution. The null hypothesis for this test states that the data come from the assumed distribution. The test compares observed values against the values you would expect to have if your data followed the assumed distribution. The test is almost always right-tailed. Each observation or cell category must have an expected value of at least five.

### Formula Review


 
  
 goodness-of-fit test statistic where

    O: observed values
E: expected values

k: number of different data cells or categories

df = k − 1 degrees of freedom
Determine the appropriate test to be used  in the next three exercises.
Use the following information to answer the next five exercises. A teacher predicts the distribution of grades on the final exam. The predictions are shown in .
The actual distribution for a class of 20 is in .
Use the following information to answer the next nine exercises. The cumulative number of cases of a chronic disease reported for Santa Clara County is broken down by ethnicity as in .
The percentage of each ethnic group in Santa Clara County is as in .

### Homework

For each problem, use a solution sheet to solve the hypothesis test problem. Go to 
Use the following information to answer the next two exercises. The columns in  contain the Race/Ethnicity of U.S. Public Schools for a recent year,  the percentages for the Advanced Placement Examinee Population for that class, and the Overall Student Population. Suppose the right column contains the results of a survey of 1,000 local students from that year who took an AP exam.
Use the following information to answer the next two exercises. UCLA conducted a survey of more than 263,000 college freshmen from 385 colleges in fall 2005. The results of students’ expected majors by gender were reported in . Suppose a survey of 5,000 graduating females and 5,000 graduating males was done as a follow-up last year to determine what their actual majors were. The results are shown in the tables for  and . The second column in each table does not add to 100 percent because of rounding.
Read the statement and decide whether it is true or false.