The Chi-Square Distribution
Site: | Saylor Academy |
Course: | BUS204: Business Statistics |
Book: | The Chi-Square Distribution |
Printed by: | Guest user |
Date: | Thursday, 3 April 2025, 5:18 PM |
Description
Read this chapter, which introduces you to the three major uses of the chi-squared distribution: the goodness-of-fit test, the test of independence, and the test of a single variance. Attempt the practice problems and homework at the end of the chapter.
Introduction

Figure 11.1 The chi-square distribution can be used to find relationships between two things, like grocery prices at different stores.
Have you ever wondered if lottery winning numbers were evenly distributed or if some numbers occurred with a greater frequency? How about if the types of movies people preferred were different across different age groups? What about if a coffee machine was dispensing approximately the same amount of coffee each time? You could answer these questions by conducting a hypothesis test.
You will now study a new distribution, one that is used to determine the answers to such questions. This distribution is called the chi-square distribution.
In this chapter, you will learn the three major applications of the chi-square distribution:
- the goodness-of-fit test, which determines if data fit a particular distribution, such as in the lottery example
- the test of independence, which determines if events are independent, such as in the movie example
- the test of a single variance, which tests variability, such as in the coffee example
Source: OpenStax, https://openstax.org/books/introductory-business-statistics/pages/11-introduction
This work is licensed under a Creative Commons Attribution 4.0 License.
Facts About the Chi-Square Distribution
The notation for the chi-square distribution is:
where df = degrees of freedom which depends on how chi-square is being used. (If you want to practice calculating chi-square probabilities then use df = n - 1. The degrees of freedom for the three major uses are each calculated differently).
For the distribution, the population mean is μ = df and the population standard deviation is
.
The random variable is shown as .
The random variable for a chi-square distribution with k degrees of freedom is the sum of k independent, squared standard normal variables.
- The curve is nonsymmetrical and skewed to the right.
- There is a different chi-square curve for each df.
Figure 11.2 - The test statistic for any test is always greater than or equal to zero.
- When df > 90, the chi-square curve approximates the normal distribution. For
the mean, μ = df = 1,000 and the standard deviation,
. Therefore, X ~ N(1,000, 44.7), approximately.
- The mean, μ, is located just to the right of the peak.
Test of a Single Variance
Thus far our interest has been exclusively on the population parameter μ or it's counterpart in the binomial, p. Surely the mean of a population is the most critical piece of information to have, but in some cases we are interested in the variability of the outcomes of some distribution. In almost all production processes quality is measured not only by how closely the machine matches the target, but also the variability of the process. If one were filling bags with potato chips not only would there be interest in the average weight of the bag, but also how much variation there was in the weights. No one wants to be assured that the average weight is accurate when their bag has no chips. Electricity voltage may meet some average level, but great variability, spikes, can cause serious damage to electrical machines, especially computers. I would not only like to have a high mean grade in my classes, but also low variation about this mean. In short, statistical tests concerning the variance of a distribution have great value and many applications.
A test of a single variance assumes that the underlying distribution is normal. The null and alternative hypotheses are stated in terms of the population variance. The test statistic is:
where:
= the total number of observations in the sample data
= sample variance
= hypothesized value of the population variance
You may think of s as the random variable in this test. The number of degrees of freedom is df = n - 1. A test of a single variance may be right-tailed, left-tailed, or two-tailed. Example 11.1 will show you how to set up the null and alternative hypotheses. The null and alternative hypotheses contain statements about the population variance.
Example 11.1
Problem
Math instructors are not only interested in how their students do on exams, on average, but how the exam scores vary. To many instructors, the variance (or standard deviation) may be more important than the average.
Suppose a math instructor believes that the standard deviation for his final exam is five points. One of his best students thinks otherwise. The student claims that the standard deviation is more than five points. If the student were to conduct a hypothesis test, what would the null and alternative hypotheses be?
Solution 1
Even though we are given the population standard deviation, we can set up the test using the population variance as follows.
Try It 11.1
A SCUBA instructor wants to record the collective depths each of his students' dives during their checkout. He is interested in how the depths vary, even though everyone should have been at the same depth. He believes the standard deviation is three feet. His assistant thinks the standard deviation is less than three feet. If the instructor were to conduct a test, what would the null and alternative hypotheses be?
Example 11.2
Problem
With individual lines at its various windows, a post office finds that the standard deviation for waiting times for customers on Friday afternoon is 7.2 minutes. The post office experiments with a single, main waiting line and finds that for a random sample of 25 customers, the waiting times for customers have a standard deviation of 3.5 minutes on a Friday afternoon.
With a significance level of 5%, test the claim that a single line causes lower variation among waiting times for customers.
Solution 1
Since the claim is that a single line causes less variation, this is a test of a single variance. The parameter is the population variance, σ2.
Random Variable: The sample standard deviation, s, is the random variable. Let s = standard deviation for the waiting times.
The word "less" tells you this is a left-tailed test.
Distribution for the test: , where:
- n = the number of customers sampled
- df = n – 1 = 25 – 1 = 24
Calculate the test statistic:
where n = 25, s = 3.5, and σ = 7.2.
Figure 11.3
The graph of the Chi-square shows the distribution and marks the critical value with 24 degrees of freedom at 95% level of confidence, α = 0.05, 13.85. The critical value of 13.85 came from the Chi squared table which is read very much like the students t table. The difference is that the students t-distribution is symmetrical and the Chi squared distribution is not. At the top of the Chi squared table we see not only the familiar 0.05, 0.10, etc. but also 0.95, 0.975, etc. These are the columns used to find the left hand critical value. The graph also marks the calculated χ2 test statistic of 5.67. Comparing the test statistic with the critical value, as we have done with all other hypothesis tests, we reach the conclusion.
Make a decision: Because the calculated test statistic is in the tail we cannot accept H0. This means that you reject . In other words, you do not think the variation in waiting times is 7.2 minutes or more; you think the variation in waiting times is less.
Conclusion: At a 5% level of significance, from the data, there is sufficient evidence to conclude that a single line causes a lower variation among the waiting times or with a single line, the customer waiting times vary less than 7.2 minutes.
Example 11.3
Professor Hadley has a weakness for cream filled donuts, but he believes that some bakeries are not properly filling the donuts. A sample of 24 donuts reveals a mean amount of filling equal to 0.04 cups, and the sample standard deviation is 0.11 cups. Professor Hadley has an interest in the average quantity of filling, of course, but he is particularly distressed if one donut is radically different from another. Professor Hadley does not like surprises.
Problem
Test at 95% the null hypothesis that the population variance of donut filling is significantly different from the average amount of filling.
Solution 1
This is clearly a problem dealing with variances. In this case we are testing a single sample rather than comparing two samples from different populations. The null and alternative hypotheses are thus:
The test is set up as a two-tailed test because Professor Hadley has shown concern with too much variation in filling as well as too little: his dislike of a surprise is any level of filling outside the expected average of 0.04 cups. The test statistic is calculated to be:
The calculated test statistic, 6.96, is in the tail therefore at a 0.05 level of significance, we cannot accept the null hypothesis that the variance in the donut filling is equal to 0.04 cups. It seems that Professor Hadley is destined to meet disappointment with each bit.
Figure 11.4
Try It 11.3
The FCC conducts broadband speed tests to measure how much data per second passes between a consumer's computer and the internet. As of August of 2012, the standard deviation of Internet speeds across Internet Service Providers (ISPs) was 12.2 percent. Suppose a sample of 15 ISPs is taken, and the standard deviation is 13.2. An analyst claims that the standard deviation of speeds is more than what was reported. State the null and alternative hypotheses, compute the degrees of freedom, the test statistic, sketch the graph of the distribution and mark the area associated with the level of confidence, and draw a conclusion. Test at the 1% significance level.
Goodness-of-Fit Test
In this type of hypothesis test, you determine whether the data "fit" a particular distribution or not. 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 or not. 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:
- O = observed values (data)
- E = expected values (from theory)
- 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.
Note
The number of expected values inside each cell needs to be at least five in order to use this test.
Example 11.4
Absenteeism of college students from math classes is a major concern to math instructors because missing class appears to increase the drop rate. Suppose that a study was done to determine if the actual student absenteeism rate follows faculty perception. The faculty expected that a group of 100 students would miss class according to Table 11.1.
Number of absences per term | Expected number of students |
---|---|
0–2 | 50 |
3–5 | 30 |
6–8 | 12 |
9–11 | 6 |
12+ | 2 |
Table 11.1
Number of absences per term | Actual number of students |
---|---|
0–2 | 35 |
3–5 | 40 |
6–8 | 20 |
9–11 | 1 |
12+ | 4 |
Table 11.2
Determine the null and alternative hypotheses needed to conduct a goodness-of-fit test.
H0: Student absenteeism fits faculty perception.
The alternative hypothesis is the opposite of the null hypothesis.
Ha: Student absenteeism does not fit faculty perception.
Number of absences per term | Expected number of students |
---|---|
0–2 | 50 |
3–5 | 30 |
6–8 | 12 |
9+ | 8 |
Number of absences per term | Actual number of students |
---|---|
0–2 | 35 |
3–5 | 40 |
6–8 | 20 |
9+ | 5 |
Table 11.4
Try It 11.4
Number produced | Number defective |
---|---|
0–100 | 5 |
101–200 | 6 |
201–300 | 7 |
301–400 | 8 |
401–500 | 10 |
Table 11.5
Number produced | Number defective |
---|---|
0–100 | 5 |
101–200 | 7 |
201–300 | 8 |
301–400 | 9 |
401–500 | 11 |
Table 11.6
Example 11.5
ProblemMonday | Tuesday | Wednesday | Thursday | Friday | |
---|---|---|---|---|---|
Number of absences | 15 | 12 | 9 | 9 | 15 |
Table 11.7 Day of the Week Employees were Most Absent
- H0: The absent days occur with equal frequencies, that is, they fit a uniform distribution.
- Ha: The absent days occur with unequal frequencies, that is, they do not fit a uniform distribution.
This time, calculate the χ2 test statistic by hand. Make a chart with the following headings and fill in the columns:
Now add (sum) the last column. The sum is three. This is the χ2 test statistic.
The calculated test statistics is 3 and the critical value of the χ2 distribution at 4 degrees of freedom the 0.05 level of confidence is 9.48. This value is found in the χ2 table at the 0.05 column on the degrees of freedom row 4.
The degrees of freedom are the number of cells – 1 = 5 – 1 = 4

Try It 11.5
Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | |
---|---|---|---|---|---|---|---|
Number of students | 11 | 8 | 10 | 7 | 10 | 5 | 5 |
Table 11.8
Example 11.6
Number of Televisions | Percent |
---|---|
0 | 10 |
1 | 16 |
2 | 55 |
3 | 11 |
4+ | 8 |
Table 11.9
The table contains expected (E) percents.
Number of Televisions | Frequency |
---|---|
0 | 66 |
1 | 119 |
2 | 340 |
3 | 60 |
4+ | 15 |
Total = 600 |
The table contains observed (O) frequency values.
This problem asks you to test whether the far western United States families distribution fits the distribution of the American families. This test is always right-tailed.
Number of televisions | Percent | Expected frequency |
---|---|---|
0 | 10 | (0.10)(600) = 60 |
1 | 16 | (0.16)(600) = 96 |
2 | 55 | (0.55)(600) = 330 |
3 | 11 | (0.11)(600) = 66 |
over 3 | 8 | (0.08)(600) = 48 |
Table 11.11
Therefore, the expected frequencies are 60, 96, 330, 66, and 48.
H0: The "number of televisions" distribution of far western United States families is the same as the "number of televisions" distribution of the American population.
Ha: The "number of televisions" distribution of far western United States families is different from the "number of televisions" distribution of the American population.
Distribution for the test:
Calculate the test statistic: χ2 = 29.65
Graph:

The graph of the Chi-square shows the distribution and marks the critical value with four degrees of freedom at 99% level of confidence, α = .01, 13.277. The graph also marks the calculated chi squared test statistic of 29.65. Comparing the test statistic with the critical value, as we have done with all other hypothesis tests, we reach the conclusion.
Make a decision: Because the test statistic is in the tail of the distribution we cannot accept the null hypothesis.
This means you reject the belief that the distribution for the far western states is the same as that of the American population as a whole.
Try It 11.6
Number of pets | Percent |
---|---|
0 | 18 |
1 | 25 |
2 | 30 |
3 | 18 |
4+ | 9 |
Table 11.12
Number of pets | Frequency |
---|---|
0 | 210 |
1 | 240 |
2 | 320 |
3 | 140 |
4+ | 90 |
Table 11.13
Example 11.7
ProblemThis problem can be set up as a goodness-of-fit problem. The sample space for flipping two fair coins is {HH, HT, TH, TT}. Out of 100 flips, you would expect 25 HH, 25 HT, 25 TH, and 25 TT. This is the expected distribution from the binomial probability distribution. The question, "Are the coins fair?" is the same as saying, "Does the distribution of the coins (20 HH, 27 HT, 30 TH, 23 TT) fit the expected distribution?"
Random Variable: Let X = the number of heads in one flip of the two coins. X takes on the values 0, 1, 2. (There are 0, 1, or 2 heads in the flip of two coins). Therefore, the number of cells is three. Since X = the number of heads, the observed frequencies are 20 (for two heads), 57 (for one head), and 23 (for zero heads or both tails). The expected frequencies are 25 (for two heads), 50 (for one head), and 25 (for zero heads or both tails). This test is right-tailed.
H0: The coins are fair.
Ha: The coins are not fair.
Distribution for the test:
Calculate the test statistic: χ2 = 2.14
Graph:

Conclusion: There is insufficient evidence to conclude that the coins are not fair: we cannot reject the null hypothesis that the coins are fair.
Test of Independence
Tests of independence involve using a contingency table of observed (data) values.
The test statistic for a test of independence is similar to that of a goodness-of-fit test:
where:
- O = observed values
- E = expected values
- i = the number of rows in the table
- j = the number of columns in the table
There are terms of the form
.
A test of independence determines whether two factors are independent or not. You first encountered the term independence in 3.2 Independent and Mutually Exclusive Events earlier. As a review, consider the following example.
Note
The expected value inside each cell needs to be at least five in order for you to use this test.
Example 11.8
Suppose A = a speeding violation in the last year and B = a cell phone user while driving. If A and B are independent then P(A ∩ B) = P(A)P(B). A ∩ B is the event that a driver received a speeding violation last year and also used a cell phone while driving. Suppose, in a study of drivers who received speeding violations in the last year, and who used cell phone while driving, that 755 people were surveyed. Out of the 755, 70 had a speeding violation and 685 did not; 305 used cell phones while driving and 450 did not.
Let y = expected number of drivers who used a cell phone while driving and received speeding violations.
If A and B are independent, then P(A ∩ B) = P(A)P(B). By substitution,
Solve for y:
About 28 people from the sample are expected to use cell phones while driving and to receive speeding violations.
In a test of independence, we state the null and alternative hypotheses in words. Since the contingency table consists of two factors, the null hypothesis states that the factors are independent and the alternative hypothesis states that they are not independent (dependent). If we do a test of independence using the example, then the null hypothesis is:
H0: Being a cell phone user while driving and receiving a speeding violation are independent events; in other words, they have no effect on each other.
If the null hypothesis were true, we would expect about 28 people to use cell phones while driving and to receive a speeding violation.
The test of independence is always right-tailed because of the calculation of the test statistic. If the expected and observed values are not close together, then the test statistic is very large and way out in the right tail of the chi-square curve, as it is in a goodness-of-fit.
The number of degrees of freedom for the test of independence is:
df = (number of columns - 1)(number of rows - 1)
The following formula calculates the expected number (E):
Try It 11.8
A sample of 300 students is taken. Of the students surveyed, 50 were music students, while 250 were not. Ninety-seven of the 300 surveyed were on the honor roll, while 203 were not. If we assume being a music student and being on the honor roll are independent events, what is the expected number of music students who are also on the honor roll?
Example 11.9
A volunteer group, provides from one to nine hours each week with disabled senior citizens. The program recruits among community college students, four-year college students, and nonstudents. In Table 11.14 is a sample of the adult volunteers and the number of hours they volunteer per week.
Type of volunteer | 1–3 Hours | 4–6 Hours | 7–9 Hours | Row total |
---|---|---|---|---|
Community college students | 111 | 96 | 48 | 255 |
Four-year college students | 96 | 133 | 61 | 290 |
Nonstudents | 91 | 150 | 53 | 294 |
Column total | 298 | 379 | 162 | 839 |
Is the number of hours volunteered independent of the type of volunteer?
H0: The number of hours volunteered is independent of the type of volunteer.
Ha: The number of hours volunteered is dependent on the type of volunteer.
Type of volunteer | 1-3 Hours | 4-6 Hours | 7-9 Hours |
---|---|---|---|
Community college students | 90.57 | 115.19 | 49.24 |
Four-year college students | 103.00 | 131.00 | 56.00 |
Nonstudents | 104.42 | 132.81 | 56.77 |
Table 11.15 Number of Hours Worked Per Week by Volunteer Type (Expected) The table contains expected (E) values (data).

Make a decision: Because the calculated test statistic is in the tail we cannot accept H0. This means that the factors are not independent.
Conclusion: At a 5% level of significance, from the data, there is sufficient evidence to conclude that the number of hours volunteered and the type of volunteer are dependent on one another.
Try It 11.9
Industry sector | 2000 | 2010 | 2020 | Total |
---|---|---|---|---|
Nonagriculture wage and salary | 13,243 | 13,044 | 15,018 | 41,305 |
Goods-producing, excluding agriculture | 2,457 | 1,771 | 1,950 | 6,178 |
Services-providing | 10,786 | 11,273 | 13,068 | 35,127 |
Agriculture, forestry, fishing, and hunting | 240 | 214 | 201 | 655 |
Nonagriculture self-employed and unpaid family worker | 931 | 894 | 972 | 2,797 |
Secondary wage and salary jobs in agriculture and private household industries | 14 | 11 | 11 | 36 |
Secondary jobs as a self-employed or unpaid family worker | 196 | 144 | 152 | 492 |
Total | 27,867 | 27,351 | 31,372 | 86,590 |
Table 11.16
Example 11.10
Need to succeed in school | High anxiety |
Med-high anxiety |
Medium anxiety |
Med-low anxiety |
Low anxiety |
Row total |
---|---|---|---|---|---|---|
High need | 35 | 42 | 53 | 15 | 10 | 155 |
Medium need | 18 | 48 | 63 | 33 | 31 | 193 |
Low need | 4 | 5 | 11 | 15 | 17 | 52 |
Column total | 57 | 95 | 127 | 63 | 58 | 400 |
Table 11.17 Need to Succeed in School vs. Anxiety Level
a. The column total for a high anxiety level is 57. The row total for high need to succeed in school is 155. The sample size or total surveyed is 400.
Problem
b. If the two variables are independent, how many students do you expect to have a low need to succeed in school and a med-low level of anxiety?
Test for Homogeneity
The goodness–of–fit test can be used to decide whether a population fits a given distribution, but it will not suffice to decide whether two populations follow the same unknown distribution. A different test, called the test for homogeneity, can be used to draw a conclusion about whether two populations have the same distribution. To calculate the test statistic for a test for homogeneity, follow the same procedure as with the test of independence.
Note
The expected value inside each cell needs to be at least five in order for you to use this test.
Hypotheses
H0: The distributions of the two populations are the same.
Ha: The distributions of the two populations are not the same.
Test Statistic
Use a χ2 test statistic. It is computed in the same way as the test for independence.
Degrees of Freedom (df)
df = number of columns - 1
Requirements
All values in the table must be greater than or equal to five.
Common Uses
Comparing two populations. For example: men vs. women, before vs. after, east vs. west. The variable is categorical with more than two possible response values.
Example 11.11
Problem
Do male and female college students have the same distribution of living arrangements? Use a level of significance of 0.05. Suppose that 250 randomly selected male college students and 300 randomly selected female college students were asked about their living arrangements: dormitory, apartment, with parents, other. The results are shown in Table 11.18. Do male and female college students have the same distribution of living arrangements?
Dormitory | Apartment | With Parents | Other | |
Males | 72 | 84 | 49 | 45 |
Females | 91 | 86 | 88 | 35 |
H0: The distribution of living arrangements for male college students is the same as the distribution of living arrangements for female college students.
Ha: The distribution of living arrangements for male college students is not the same as the distribution of living arrangements for female college students.
Degrees of Freedom (df):
df = number of columns – 1 = 4 – 1 = 3
Distribution for the test:
Calculate the test statistic:

Make a decision: Because the calculated test statistic is in the tail we cannot accept H0. This means that the distributions are not the same.
Conclusion: At a 5% level of significance, from the data, there is sufficient evidence to conclude that the distributions of living arrangements for male and female college students are not the same.
Try It 11.11
Sport | Sedan | Hatchback | Truck | Van/SUV | |
---|---|---|---|---|---|
Family | 5 | 15 | 35 | 17 | 28 |
Single | 45 | 65 | 37 | 46 | 7 |
Try It 11.11
Application type accepted | Brown | Columbia | Cornell | Dartmouth | Penn | Yale |
---|---|---|---|---|---|---|
Regular | 2,115 | 1,792 | 5,306 | 1,734 | 2,685 | 1,245 |
Early decision | 577 | 627 | 1,228 | 444 | 1,195 | 761 |
Table 11.20
We want to know if the number of regular applications accepted follows the same distribution as the number of early applications accepted. State the null and alternative hypotheses, the degrees of freedom and the test statistic, sketch the graph of the χ2 distribution and show the critical value and the calculated value of the test statistic, and draw a conclusion about the test of homogeneity.
Comparison of the Chi-Square Tests
Above the χ2 test statistic was used in three different circumstances. The following bulleted list is a summary of which χ2 test is the appropriate one to use in different circumstances.
- Goodness-of-Fit: Use the goodness-of-fit test to decide whether a population with an unknown distribution "fits" a known distribution. In this case there will be a single qualitative survey question or a single outcome of an experiment from a single population. Goodness-of-Fit is typically used to see if the population is uniform (all outcomes occur with equal frequency), the population is normal, or the population is the same as another population with a known distribution. The null and alternative hypotheses are:
H0: The population fits the given distribution.
Ha: The population does not fit the given distribution. - Independence: Use the test for independence to decide whether two variables (factors) are independent or dependent. In this case there will be two qualitative survey questions or experiments and a contingency table will be constructed. The goal is to see if the two variables are unrelated (independent) or related (dependent). The null and alternative hypotheses are:
H0: The two variables (factors) are independent.
Ha: The two variables (factors) are dependent. - Homogeneity: Use the test for homogeneity to decide if two populations with unknown distributions have the same distribution as each other. In this case there will be a single qualitative survey question or experiment given to two different populations. The null and alternative hypotheses are:
H0: The two populations follow the same distribution.
Ha: The two populations have different distributions.