Login
📚 Mostly Harmless Statistics
Chapters ▾

10 Chi-Square Tests

10.01: Chi-Square Distribution

A \(\chi^{2}\) -distribution (chi-square, pronounced “ki-square”) is another special type of distribution for a continuous random variable. The sampling distribution for a variance and standard deviation follows a chi-square distribution.

Properties of the \(\chi^{2}\) -distribution density curve:

  1. Right skewed starting at zero.
  2. The center and spread of a \(\chi^{2}\) -distribution are determined by the degrees of freedom with a mean = df and standard deviation = \(\sqrt{2df}\).
  3. Chi-square variables cannot be negative.
  4. As the degrees of freedom increase, the \(\chi^{2}\) -distribution becomes normally distributed for df > 50. Figure 10-1 shows \(\chi^{2}\) -distributions for df of 2, 4, 10, and 30.
  5. The total area under the curve is equal to 1, or 100%.
clipboard_e4bc6fcabad9b911d3a268aeaf5de1162.png
Figure 10-1

We will use the \(\chi^{2}\) -distribution for hypothesis testing later in this chapter. For now, we are just learning how to find a critical value \(\chi_{\alpha}^{2}\).

The symbol \(\chi_{\alpha}^{2}\) is the critical value on the \(\chi^{2}\) -distribution curve with area 1 – \(\alpha\) below the critical value and area \(\alpha\) above the critical value, as shown below in Figure 10-2.

clipboard_edff4463e62adbaa4742b5fa29a80fb4d.png
Figure 10-2

Use technology to compute the critical value for the \(\chi^{2}\) -distribution.

TI-84: Use the INVCHI2 program downloaded at Rachel Webb’s website: http://MostlyHarmlessStatistics.com. Start the program and enter the area \(\alpha\) and the df when prompted.

TI-89: Go to the [Apps] Stat/List Editor, then select F5 [DISTR]. This will get you a menu of probability distributions. Arrow down to Inverse > Inverse Chi-Square and press [ENTER]. Enter the area 1 – \(\alpha\) to the left of the \(\chi\) value and the df into each cell. Press [ENTER].

Excel: =CHISQ.INV(1 – \(\alpha\), df) or =CHISQ.INV.RT(\(\alpha\), df)

Alternatively, use the following online calculator: https://homepage.divms.uiowa.edu/~mbognar/applets/chisq.html.

Compute the critical value \(\chi_{\alpha}^{2}\) for a \(\alpha\) = 0.05 and df = 6.

Solution

Start by drawing the curve and determining the area in the right-tail as shown in Figure 10-3. Then use technology to find the critical value.

 clipboard_e7be50b99403a71daef1d9a363b5f5d48.png
Figure 10-3

In Excel there are two options. Use =CHISQ.INV(area in left-tail,df) or right-tail =CHISQ.INV.RT(area in righttail,df). For this example, then we would have \(\chi_{\alpha}^{2}\) =CHISQ.INV(0.95,6) or =CHISQ.INV.RT(0.05,6) = 12.5916.

TI-89 use Distr > Inverse Chi-square with area 0.95 and df = 6

clipboard_ea1a1baed623f4f3224c7d4d4dfa2fe6f.png

10.02: Goodness of Fit Test

The \(\chi^{2}\) goodness-of-fit test can be used to test the distribution of three or more proportions within a single population.

Definition: \(\chi^{2}\) goodness-of-fit test

The \(\chi^{2}\)-test is a statistical test for testing the goodness-of-fit of a variable. It can be used when the data are obtained from a random sample and when the expected frequency (E) from each category is 5 or more.

The formula for the \(\chi^{2}\) -test statistic is:

\[\chi^{2}=\sum \frac{(o-E)^{2}}{E}\]

Use a right-tailed \(\chi^{2}\) -distribution with \(\text{df} = k-1\) where \(k\) = the number of categories.

with

  • \(O\) = the observed frequency (what was observed in the sample) and
  • \(E\) = the expected frequency (based on \(H_{0}\) and the sample size).
  • \(H_{0}: p_{1} = p_{0}, p_{2} = p_{0}, \cdots, p_{k} = p_{0}\)
  • \(H_{1}:\) At least one proportion is different.

An instructor claims that their students’ grade distribution is different than the department’s grade distribution. The department’s grades have the following proportion of students who get A’s is 35%, B’s is 23%, C’s is 25%, D’s is 10% and F’s is 7% in introductory statistics courses. For a sample of 250 introductory statistics students with this instructor, there were 80 A’s, 50 B’s, 58 C’s, 38 D’s, and 24 F’s. Test the instructor’s claim at the 5% level of significance.

Solution

This is a test for three or more proportions within a single population, so use the goodness-of-fit test. We will always use a right-tailed χ 2 -test. The hypotheses for this example would be:

\(H_{0}: p_{A} = 0.35, p_{B} = 0.23, p_{C} = 0.25, p_{D} = 0.10, p_{F} = 0.07\)

\(H_{1}:\) At least one proportion is different.

Even though there is an inequality in \(H_{1}\), the goodness-of-fit test is always a right-tailed test. This is because we are testing to see if there is a large variation between the observed versus the expected values. If the variance between the observed and expected values is large, then there is a difference in the proportions.

Also note that we do not write the alternative hypothesis as \(p_{A} \neq 0.35, p_{B} \neq 0.23, p_{C} \neq 0.25, p_{D} \neq 0.10, p_{F} \neq 0.07\) since it could be that any one of these proportions is different. All of the proportions not being equal to their hypothesized values is just one possible case.

There are \(k = 5\) categories that we are comparing: A’s, B’s, C’s, D’s and F’s.

The observed counts are the actual number of A’s, B’s, C’s, D’s and F’s from the sample.

We must compute the expected count for each of the five categories. Find the expected counts by multiplying the expected proportion of A’s, B’s, C’s, D’s and F’s by the sample size.

It will be helpful to make a table to organize the work.

clipboard_edf6189cb1f8835e73a637c3d5408caa7.png

The test statistic is the sum of this last row: \(\chi^{2}=\sum \frac{(O-E)^{2}}{E}=0.6429+0.9783+0.324+6.76+2.4143=11.1195\)

The critical value for a right-tailed \(\chi^{2}\)-test with \(\text{df} = k - 1 = 5 - 1 = 4\) is found by finding the area in the \(\chi^{2}\) -distribution using your calculator or Excel. Use \(\alpha = 0.05\) area in the right-tail, to get the critical value of \(\chi_{\alpha}^{2}\) =CHISQ.INV.RT(0.05,4) = 9.4877. Draw and label the curve as shown in Figure 10-4.

clipboard_e3e8a56681c8f77c2b797277e915d1bb9.png
Figure 10-4: Values of \(\chi_{\alpha}^{2}\) and \(\chi^{2}\) on a \(\chi^{2}\)-test with \(\text{df}=4\) and \(\alpha=0.05\).

The test statistic of \(\chi^{2} = 11.1195 > \chi_{\alpha}^{2} = 9.4877\) and is in the rejection area, so our decision is: Reject \(H_{0}\).

There is sufficient evidence to support the claim that the proportion of students who get A’s, B’s, C’s, D’s and F’s in introductory statistics courses for this instructor is different than the department’s proportions of 35%, 23%, 25%, 10% and 7% respectively.

If we were asked to find the p-value, you would just find the area to right of the test statistic (always a right-tailed test) using your calculator or Excel =CHISQ.DIST.RT(11.1195,4) = 0.0253.

clipboard_ebbb6309679f3d6526bf6e6e990fbbe41.png

This gives a p-value = 0.0252 which is less than \(\alpha = 0.05\), therefore reject \(H_{0}\).

You can use the GOF shortcut function on your calculator to get a p-value; see directions below. If you get the program from your instructor or the website for your TI-83, you can also have the calculator find the \(\frac{(O-E)^{2}}{E}\) values. The TI-84 and 89 already does this.

TI-84: Note: For the TI-83 download a GOF program from http://MostlyHarmlessStatistics.com. Only newer TI-84 operating systems have a calculator shortcut key for GOF. Use the same GOF program as for the TI-83 if your 84 does not have the \(\chi^{2}\) GOF-Test.

Before you start, write down your observed and expected values. Select Stat, then Calc. Type in the observed values into list 1, and the expected values into list 2. Select Stat, then Tests. Go down to option D: \(\chi^{2}\) GOF-Test. Choose L1 for the Observed category and L2 for the Expected category, type in your degrees of freedom (\(\text{df} = k-1\)), and then select Calculate. The calculator returns the \(\chi^{2}\) -test statistic and the p-value. Use the right arrow to see the rest of the \(\frac{(O-E)^{2}}{E}\) values.

clipboard_e93be4bb1ca462123ed8c6f1f17d81bc8.png

TI-89: Go to the [Apps] Stat/List Editor, then type in the observed values into list 1, and the expected values into list 2. Press [2nd] then F6 [Tests], then select 7: Chi-2GOF. Type in the list names and the degrees of freedom (\(\text{df} = k-1\)). Then press the [ENTER] key to calculate. The calculator returns the \(\chi^{2}\)-test statistic and the p-value. The \(\frac{(O-E)^{2}}{E}\) values are stored in the comp list.

clipboard_ee36829f969e14ac84a17e15cb97f215c.png

A research company is looking to see if the proportion of consumers who purchase a cereal is different based on shelf placement. They have four locations: Bottom Shelf, Middle Shelf, Top Shelf, and Aisle End Shelf. Test to see whether there is a preference among the four shelf placements. Use the p-value method with \(\alpha=0.05\).

clipboard_e0da0af4e040bc74ad45b7637e163db4f.png

Solution

The hypotheses can be written as a sentence or as proportions. If you use proportions, note that there are no percentages given. We would expect that each shelf placement be the same if there was no preference. There are 4 categories, so \(p_{0} = \frac{1}{4} = 0.25\) or 25% for each placement.

  • \(H_{0}: p_{B} = 0.25, p_{M} = 0.25, p_{T} = 0.25, p_{E} = 0.25\)
  • \(H_{1}:\) At least one proportion is different.

It is also acceptable to write the hypotheses as a sentence.

  • \(H_{0}:\) Proportion of cereal sales is equally distributed across the four shelf placements.
  • \(H_{1}:\) Proportion of cereal sales is not equally distributed across the four shelf placements.

Find the expected values. Total all the observed values to get the sample size: \(n = 45 + 67 + 55 + 73 = 240\). Then take the sample size and divide by 4 to get \(\frac{240}{4} = 60\). The expected value for each group is 60.

Compute the test statistic:

\[\begin{aligned} \chi^{2} &=\sum \frac{(O-E)^{2}}{E} = \frac{(45-60)^{2}}{60} + \frac{(67-60)^{2}}{60} + \frac{(55-60)^{2}}{60} + \frac{(73-60)^{2}}{60} \\[4pt] &=3.75+0.816667+0.416667+2.816667=7.8 \end{aligned}\]

Check your work using technology and find the p-value. The degrees of freedom are the number of groups minus one: \(\text{df} = k - 1 = 3\).

clipboard_ea454a322856715e8b04546d701a2c1c7.png

You can scroll right by selecting the right arrow button to see the rest of the contribution values.

In Excel the p-value is found by the formula =CHISQ.DIST.RT(7.8,3). On the TI-Calculator, use the \(\chi^{2}\) GOF-Test shortcut. The p-value = 0.05033 which is larger than \(\alpha=0.05\); therefore, do not reject \(H_{0}\).

There is not enough evidence to support the claim that cereal shelf placement makes a statistically significant difference in the proportion of sales at the 5% level of significance.

10.03: Test for Independence

Use the chi-square test for independence to test the independence of two categorical variables. Remember, qualitative data is collected on individuals that are categories or names. Then you would count how many of the individuals had particular qualities. An example is that there is a theory that there is a relationship between breastfeeding and having autism spectrum disorder (ASD). To determine if there is a relationship, researchers could collect the time-period that a mother breastfed her child and if that child was diagnosed with ASD. Then you would have a table containing this information. Now you want to know if each cell is independent of each other cell. Remember, independence says that one event does not affect another event. Here it means that having ASD is independent of being breastfed. What you really want is to see if they are dependent (not independent). In other words, does one affect the other? If you were to do a hypothesis test, this is your alternative hypothesis and the null hypothesis is that they are independent. There is a hypothesis test for this and it is called the chi-square test for independence.

There is only a right-tailed test for testing the independence between two variables:

\(H_{0}:\) Variable 1 and Variable 2 are independent (unrelated).

\(H_{1}:\) Variable 1 and Variable 2 are dependent (related).

Finding the test statistic involves several steps. First, the data is collected, counted, and then organized into a contingency table. These values are known as the observed frequencies, and the symbol for an observed frequency is \(O\). Total each row and column.

The null hypothesis is that the two variables are independent. If two events are independent then \(P(B) = P(B | A)\) and we can use the multiplication rule for independent events, to calculate the probability that variable \(A\) and \(B\) as the \(P(A\, \text{and}\, B) = P(A) \cdot P(B)\). Remember in a hypothesis test, you assume that \(H_{0}\) is true, the two variables are assumed to be independent.

\[\begin{aligned} P(A\, \text{and}\, B) &= P(A) \cdot P(B) \text{ if } A \text{ and } B \text{ are independent} \\[4pt] &=\dfrac{\text { Number of ways A can happen }}{\text { Total number of individuals }} \cdot \dfrac{\text { Number of ways B can happen }}{\text { Total number of individuals }} \\[4pt] &=\dfrac{\text { Row Total }}{n} \cdot \dfrac{\text { Column Total }}{n} \end{aligned}\]

clipboard_e213d5b4384ece8c34ed524504b06682c.png

Now you want to find out how many individuals you expect to be in a certain cell. To find the expected frequencies, you just need to multiply the probability of that cell times the total number of individuals. Do not round the expected frequencies.

\[\begin{aligned} \text{Expected frequency (cell A and B)} &= E(A \text{ and } B) \\ &= n \left(\dfrac{\text { Row Total }}{n} \cdot \dfrac{\text { Column Total }}{n}\right) = \dfrac{\text { Row Total } \cdot \text { Column Total }}{n} \end{aligned}\]

If the variables are independent, the expected frequencies and the observed frequencies should be the same.

The test statistic here will involve looking at the difference between the expected frequency and the observed frequency for each cell. Then you want to find the “total difference” of all of these differences. The larger the total, the smaller the chances that you could find that test statistic given that the assumption of independence is true. That means that the assumption of independence is not true.

How do you find the test statistic? First, compute the differences between the observed and expected frequencies. Because some of these differences will be positive and some will be negative, you need to square these differences. These squares could be large just because the frequencies are large, so you need to divide by the expected frequencies to scale them. Then finally add up all of these fractional values. This process finds the variance, and we use a chi-square distribution to find the critical value or p-value. Hence, sometimes this test is called a chi-square test.

The \(\chi^{2}\)-test is a statistical test for testing the independence between two variables. It can be used when the data are obtained from a random sample, and when the expected value \((E)\) from each cell is 5 or more.

The formula for the \(\chi^{2}\) -test statistic is: \(\chi^{2} = \sum \frac{(O-E)^{2}}{E}\).

Use \(\chi^{2}\) -distribution with degrees of freedom

\(\text{df}\) = (the number of rows – 1) (the number of columns – 1), that is, \(\text{df} = (R-1)(C-1)\).

where \(O\) = the observed frequency (sample results) and

\(E\) = the expected frequency (based on \(H_{0}\) and the sample size).

Is there a relationship between autism spectrum disorder (ASD) and breastfeeding? To determine if there is, a researcher asked mothers of ASD and non-ASD children to say what time-period they breastfed their children. Does the data provide enough evidence to show that breastfeeding and ASD are independent? Test at the 1% level.

clipboard_e9e21c5afe385c1f4aa7cf9866438e2e3.png

(Schultz, Klonoff-Cohen, Wingard, Askhoomoff, Macera, Ji & Bacher, 2006.)

Solution

The question is asking if breastfeeding and ASD are independent. The correct hypothesis is:

\(H_{0}:\) Autism spectrum disorder and length of breastfeeding are independent.

\(H_{1}:\) Autism spectrum disorder and length of breastfeeding are dependent.

There are 2 rows and 4 columns of data. We must compute the Expected count for each of the \(2 \times 4 = 8\) cells.

The expected counts for each cell are found by the formula:

\(\text { Expected Value } = \dfrac{\text { Row Total } \cdot \text { Column Total }}{\text { Grand Total }}\)

It will be helpful to make a table for the expected counts and another one for each of the \(\frac{(O-E)^{2}}{E}\) values to aid in computing the test statistic.

clipboard_e4aaf065dbc62269cd732d5edaf920dc1.png

The test statistic is the sum of all eight \(\frac{(O-E)^{2}}{E}\) values: \(\chi^{2}=\sum \frac{(O-E)^{2}}{E} = 11.217\).

The critical value for a right-tailed \(\chi^{2}\)-test with degrees of freedom \(\text{df} = (R-1)(C-1) = (2-1)(4-1) = 3\) is found using a \(\chi^{2}\) -distribution \(\alpha=0.01\) right-tail area. The critical value is \(\chi^{2}\) = CHISQ.INV.RT(0.01,3) = 11.3449. See Figure 10-5.

clipboard_e5a5e98a698caf62f5ed6f5400ed4c8b2.png
Figure 10-5: Values of \(\chi^{2}\) and \(\chi_{\alpha}^{2}\) on a \(\chi^{2}\)-test with \(\text{df}=3\) and \(\alpha=0.01\).

Alternatively, use the online calculator: https://homepage.divms.uiowa.edu/~mbognar/applets/chisq.html.

clipboard_e6d35d3d382bf3e4b9b4a00bf33727b7d.png

Since the test statistic \(\chi^{2} = 11.217\) is not in the rejection area, our decision is to fail to reject \(H_{0}\).

There is not enough evidence to show a relationship between autism spectrum disorder and breastfeeding.

clipboard_e310911b2518d7aa21b42b31be4b77af0.png

If we were asked to find the p-value, you would just find the area to right of the test statistic (always a right-tailed test) using your calculator or Excel. This gives a p-value = 0.0106, which is more than \(\alpha=0.01\); therefore, we do not reject H0.

You can also use the \(\chi^{2}\)-Test shortcut keys on your calculator to get a p-value, see directions below.

TI-84: Press the [2nd] then [MATRX] key. Arrow over to the EDIT menu and 1:[A] should be highlighted, press the [ENTER] key. For a \(m \times n\) contingency table, type in the number of rows \((m)\) and the number of columns \((n)\) at the top of the screen so that it looks like this: MATRIX[A] \(m \times n\). For a \(2 \times 4\) contingency table, the top of the screen would look like this: MATRIX[A] \(2 \times 4\). As you hit [ENTER], the table will automatically widen to the size you put in. Now enter all of the observed values in their proper positions. Then press the [STAT] key, arrow over to the [TESTS] menu, arrow down to the option [C: \(\chi^{2}\) -Test] and press the [ENTER] key. Leave the default as Observed:[A] and Expected:[B], arrow down to [Calculate] and press the [ENTER] key.

The calculator returns the \(\chi^{2}\)-test statistic and the p-value.

If you go back to the matrix menu [2nd] then [MATRX] key, arrow over to EDIT and choose 2:[B], you will see all of the expected values.

clipboard_ef2b107930424500e6b9f219631f5c2f8.png

TI-89: First you need to create the matrix for the observed values: Press [Home] to return to the Home screen, press [Apps] and select Data/Matrix Editor. A menu is displayed, select 3:New. The New dialog box is displayed. Press the right arrow key to highlight 2:Matrix, and press [ENTER] to choose Matrix type. Press the down arrow key to highlight 1:Main, and press [ENTER], to choose main folder. Press the down arrow key, and then enter the letter \(o\) for the name in the Variable field. Enter 2 for Row dimension and 4 for Column dimension. Press [ENTER] to display the matrix editor. Enter the observed value (do not include total row or column). Important: Next time you use this test instead of option 3:New, choose 2: Open. The open dialog box is displayed. Press the right arrow key to highlight 2:Matrix, and press [ENTER] to choose Matrix type. Press the down arrow key to make sure you are in the Main folder and that your variable says \(o\). Press [Apps], and then select Stats/List Editor. To display the Chi-square 2-Way dialog box, press 2nd then F6 [Tests], then select 8: Chi-2 2-way. Enter in in the Observed Mat: o; leave the other rows alone: Store Expected to: statvars\e; Store CompMat to: statvars\c. This will store the expected values in the matrix folder statvars with the name expmat, and the \((o-e)^{2}/e\) values in the matrix compmat. Press the [ENTER] key to calculate. The calculator returns the \(\chi^{2}\)-test statistic and the p-value. If you go back to the matrix menu, you will see some of the expected and \((o-e)^{2}/e\) values.

clipboard_ed9d80990f0c215630f4a8e4b6d0e20af.png

To see all the expected values, select [APPS] and select Data/Matrix Editor. Select 2:Open, change the Type to Matrix, change the Folder to statvars, and change the Variable to expmat.

clipboard_e681dd9ee9f37d7d0b060afd2f7fbc1d1.png

To see all the \((o-e)^{2}/e\) values, select [APPS] and select Data/Matrix Editor. Select 2:Open, change the Type to Matrix, change the Folder to statvars, and change the Variable to compmat.

clipboard_ed06ab78452183dc5b167fbee873ce999.png

If you need to delete a row or column, move the cursor to the row or column that you want to delete, then select F6 Util, then 2:Delete, then choose row or column, then enter. To add a row or column, just arrow over to the new row or column and type in the observed values.

clipboard_eb0b11842a11c5649da46fbf9cce9c0f0.png

The sample data below show the number of companies providing dental insurance for small, medium and large companies. Test to see if there is a relationship between dental insurance coverage and company size. Use \(\alpha=0.05\).

clipboard_e1b93a26c37f1b74727282ebc5ae920a1.png

Solution

State the hypotheses.

\(H_{0}:\) Dental insurance coverage and company size are independent.

\(H_{1}:\) Dental insurance coverage and company size are dependent.

Compute the expected values by taking each row total times column total, divided by grand total.

clipboard_e6287eecefc05884ec70845d46b602c89.png

For the small companies with dental insurance: \((65 \cdot 67)/160 = 27.21875\),

small companies without dental insurance: \((95 \cdot 67)/160 = 39.78125\),

medium companies with dental insurance: \((65 \cdot 64)/160 = 26\), etc. See table below.

clipboard_e720e9b331b113a6b70475bc26bf4add9.png

Compute the test statistic.

clipboard_e4c327a1de6d7f367eb77efa7b912d6eb.png

Test statistic is \(\chi^{2}=\sum \dfrac{(O-E)^{2}}{E}=1.42082+0.03846+4.42316+0.97214+0.02632+3.02637=9.9073\).

Use technology to find the p-value using the chi-square cdf with \(\text{df} = (R-1)(C-1) = (2-1)(3-1) = 2\).

clipboard_eee51805afb254f2b5a1f9b2521e3d586.png

Using the TI-Calculator, we find the p-value = 0.0071.

The p-value is less than \(\alpha\); therefore, reject \(H_{0}\).

There is enough evidence to support the claim that there is a relationship between dental insurance coverage and company size.

10.04: Chapter 10 Formulas

Goodness of Fit Test

\(H_{0}: p_{1} = p_{0}, p_{2}= p_{0}, \cdots, p_{k} = p_{0}\).

\(H_{1}:\) At least one proportion is different.

\(\chi^{2}=\sum \frac{(O-E)^{2}}{E}\)

\(\text{df} = k-1\), \(p_{0} = \frac{1}{k}\) or given %

TI-84: \(\chi^{2}\) GOF-Test

Test for Independence

\(H_{0}:\) Variable 1 and Variable 2 are independent.

\(H_{1}:\) Variable 1 and Variable 2 are dependent.

\(\chi^{2}=\sum \frac{(O-E)^{2}}{E}\)

\(\text{df} = (R-1)(C-1)\)

TI-84: \(\chi^{2}\)-Test

One of the major selling points of that wholly remarkable travel book, the Hitchhiker's Guide to the Galaxy, apart from its relative cheapness and the fact that it has the words DON'T PANIC written in large friendly letters on its cover, is its compendious and occasionally accurate glossary. The statistics relating to the geo‐social nature of the Universe, for instance, are deftly set out between pages nine hundred and thirty‐eight thousand and twenty-four and nine hundred and thirty‐eight thousand and twenty‐six; and the simplistic style in which they are written is partly explained by the fact that the editors, having to meet a publishing deadline, copied the information off the back of a packet of breakfast cereal, hastily embroidering it with a few footnotes in order to avoid prosecution under the incomprehensibly tortuous Galactic Copyright laws.

(Adams, 2002)

10.05: Chapter 10 Exercises

Chapter 10 Exercises

1. The shape of the \(\chi^{2}\) -distribution is usually:

a) Normal

b) Bell-shaped

c) Skewed left

d) Skewed right

e) Uniform


2. Why are Goodness of Fit tests always right-tailed?

a) Because the test checks for a large variance between observed and expected values.

b) Because the \(\chi^{2}\)-distribution is skewed right.

c) Because \(\chi^{2}\) values can never be negative.

d) Because they test a variance and variance is always positive.


3. What are the requirements to be satisfied before using a Goodness of Fit test? Check all that apply.

a) The data are obtained using systematic sampling.

b) The data are obtained from a simple random sample.

c) The expected frequency from each category is 5 or more.

d) The observed frequency from each category is organized from largest to smallest.

e) The degrees of freedom are less than 30.


For exercises 4-19, show all 5 steps for hypothesis testing:

a) State the hypotheses.

b) Compute the test statistic.

c) Compute the critical value or p-value.

d) State the decision.

e) Write a summary.

4. Pamplona, Spain, is the home of the festival of San Fermin – The Running of the Bulls. The town is in festival mode for a week and a half every year at the beginning of July. There is a running joke in the city that Pamplona has a baby boom every April – 9 months after San Fermin. To test this claim, a resident takes a random sample of 200 birthdays from native residents and finds the following. At the 0.05 level of significance, can it be concluded that births in Pamplona are not equally distributed throughout the 12 months of the year?

clipboard_e58309d63aa24fbc2320c51ac22f10e98.png

5. A professor using an open-source introductory statistics book predicts that 60% of the students will purchase a hard copy of the book, 25% will print it out from the web, and 15% will read it online. At the end of the term she asks her students to complete a survey where they indicate what format of the book they used. Of the 126 students, 45 said they bought a hard copy of the book, 25 said they printed it out from the web, and 56 said they read it online. Run a Goodness of Fit test at \(\alpha\) = 0.05 to see if the distribution is different than expected.

6. The proportion of final grades for an anatomy class for the whole department are distributed as 10% A's, 23% B's, 45% C's, 14% D's, and 8% F's. A department chair is getting quite a few student complaints about a particular professor. The department chair wants to check to see if the professor’s students’ grades have a different distribution compared to the rest of the department. At the end of the term, the students have the following grades. Use \(\alpha\) = 0.05.

clipboard_e3a381dee0ea3ccfee88e81a51730a7af.png

7. You might think that if you looked at the first digit in randomly selected numbers that the distribution would be uniform. Actually, it is not! Simon Newcomb and later Frank Benford both discovered that the digits occur according to the following distribution.

clipboard_e43eb51c465de0760c59e3500423825e7.png

A forensic accountant can use Benford's Law to detect fraudulent tax data. Suppose you work for the IRS and are investigating an individual suspected of embezzling. The first digit of 192 checks to a supposed company are as follows.

clipboard_e633a1325397900964e8bfe362e04da2d.png

Run a complete Goodness of Fit test to see if the individual is likely to have committed tax fraud. Use \(\alpha\) = 0.05. Should law enforcement officials pursue the case? Explain.

8. A college professor is curious if location of seat in class affects grade in the class. She is teaching in a lecture hall to 200 students. The lecture hall has 10 rows, so she splits it into 5 categories – Rows 1-2, Rows 3-4, Rows 5-6, Rows 7-8, and Rows 9-10. At the end of the course, she determines the top 25% of grades in the class, and if location of seat makes no difference, she would expect that these top 25% of students would be equally dispersed throughout the classroom. Her observations are recorded below. Run a Goodness of Fit test to determine whether location has an impact on grade. Let \(\alpha\) = 0.05.

clipboard_e7bb9abfc2eefc08718d3066b2ec075df.png

9. Consumer panel preferences for four store displays follow. Test to see whether there is a preference among the four display designs. Use \(\alpha\) = 0.05.

clipboard_ef2146c6676b5135944ac410a6fffd007.png

10. The manager of a coffee shop wants to know if his customers’ drink preferences have changed in the past year. He knows that last year the preferences followed the following proportions – 34% Americano, 21% Cappuccino, 14% Espresso, 11% Latte, 10% Macchiato, 10% Other. In a random sample of 300 customers, he finds that 90 ordered Americanos, 65 ordered Cappuccinos, 52 ordered Espressos, 35 ordered Lattes, 34 ordered Macchiatos, and the rest ordered something in the Other category. Run a Goodness of Fit test to determine whether drink preferences have changed at his coffee shop. Use a 0.05 level of significance.

11. The director of a Driver’s Ed program is curious if the time of year has an impact on number of car accidents in the United States. They assume that weather may have a significant impact on the ability of drivers to control their vehicles. They take a random sample of 100 car accidents and record the season each occurred in. They found that 20 occurred in the spring, 31 in the summer, 23 in the fall, and 26 in the winter. Can it be concluded at the 0.05 level of significance that car accidents are not equally distributed throughout the year?

12. A college prep school advertises that their students are more prepared to succeed in college than other schools. To show this, they categorize GPAs into 4 groups and look up the proportion of students at a state college in each category. They find that 7% have a 0-0.99, 21% have a 1-1.99, 37% have a 2-2.99, and 35% have a 3-4.00 in GPA. They then take a random sample of 150 of their graduates at the state college and find that 5 graduates have a 0- 0.99, 18 have a 1-1.99, 67 have a 2-2.99, and 60 have a 3-4.00. Can they conclude that the grades of their graduates are distributed differently than the general population at the school? Test at the 0.05 level of significance.

13. The permanent residence of adults aged 18-25 in the United States was examined in a survey from the year 2000. The survey revealed that 27% of these adults lived alone, 32% lived with a roommate(s), and 41% lived with their parents/guardians. In 2008, during an economic recession in the country, another such survey of 1,500 people revealed that 378 lived alone, 452 lived with a roommate(s), and 670 lived with their parents. Is there a significant difference in where young adults lived in 2000 versus 2008? Test with a Goodness of Fit test at \(\alpha\) = 0.05.

14. A color code personality test categorizes people into four colors – Red (Power), Blue (Intimacy), Green (Peace), and Yellow (Fun). In general, 25% of people are Red, 35% Blue, 20% Green, and 20% Yellow. An art class of 33 students is tested at a university and 4 are found to be Red, 14 Blue, 7 Green, and 8 Yellow. Can it be concluded that personality type has an impact on students’ areas of interest and talents, such as artistic students? Test at a 0.05 level of significance.

15. An urban economist is curious if the distribution in where Oregon residents live is different today than it was in 1990. She observes that today there are approximately 3,050 thousand residents in NW Oregon, 907 thousand residents in SW Oregon, 257 thousand in Central Oregon, and 106 thousand in Eastern Oregon. She knows that in 1990 the breakdown was as follows: 72.7% NW Oregon, 19.7% SW Oregon, 4.8% Central Oregon, and 2.8% Eastern Oregon. Can she conclude that the distribution in residence is different today at a 0.05 level of significance?

16. A large department store is curious what sections of the store make the most sales. The manager has data from 10 years prior that show 30% of sales come from Clothing, 25% Home Appliances, 18% Housewares, 13% Cosmetics, 12% Jewelry, and 2% Other. In a random sample of 500 current sales, 176 came from Clothing, 150 from Home Appliances, 75 from Housewares, 42 from Cosmetics, 51 from Jewelry, and 6 from Other. At \(\alpha\) = 0.10, can the manager conclude that the distribution of sales among the departments has changed?

17. Students at a high school are asked to evaluate their experience in a class at the end of each school year. The courses are evaluated on a 1-4 scale – with 4 being the best experience possible. In the History Department, the courses typically are evaluated at 10% 1’s, 15% 2’s, 34% 3’s, and 41% 4’s. A new history teacher, Mr. Mendoza, sets a goal to outscore these numbers. At the end of the year, he takes a random sample of his evaluations and finds 11 1’s, 14 2’s, 47 3’s, and 53 4’s. At the 0.05 level of significance, can Mr. Mendoza claim that his evaluations are significantly different from the History Department’s?

18. A company manager believes that a person’s ability to be a leader is directly related to their zodiac sign. He never selects someone to chair a committee without first evaluating their zodiac sign. An irate employee sets out to show her manager is wrong. She claims that if zodiac sign truly makes a difference in leadership, then a random sample of 200 CEOs in our country would reveal a difference in zodiac sign distribution. She finds the following zodiac signs for her random sample of 200 CEOs. Can the employee conclude that there is a difference in the proportion of CEOs for the twelve zodiac signs? Use \(\alpha\) = 0.05.

clipboard_e6b1c84e4922ba419d506597a9aa0428f.png

19. A company that develops over-the-counter medicines is working on a new product that is meant to shorten the length of time that sore throats persist. To test their product for effectiveness, they take a random sample of 100 people and record how long it took for their symptoms to completely disappear. The results are in the table below. The company knows that on average (without medication) it takes a sore throat 6 days or less to heal 42% of the time, 7-9 days 31% of the time, 10-12 days 16% of the time, and 13 days or more 11% of the time. Can it be concluded at the 0.01 level of significance that the patients who took the medicine healed at a different rate than these percentages?

clipboard_e32ef6a63253399246172599dcc934ade.png


20. What are the requirements to be satisfied before using the \(\chi^{2}\) Independence Test? Check all that apply.

a) The sample sizes must be greater than 30.

b) The data are obtained from a random sample.

c) The data are obtained using stratified sampling.

d) The expected frequency from each category is 5 or more.

e) The observed frequency from each category is organized from largest to smallest.

f) The population is normally distributed.


21. The null hypothesis for the \(\chi^{2}\) Independence Test always states that _____________________________.

a) the two values are equal.

b) one variable is dependent on another variable.

c) one variable is independent of another variable.

d) the expected values and observed values are the same.


22. What are the degrees of freedom used in the \(\chi^{2}\) Independence Test?

a) \(n - 1\)

b) \(\text{Rows} + \text{Columns}\)

c) \(n\)

d) \((\text{Rows} - 1) \times (\text{Columns} - 1)\)

e) \(n - 2\)


For exercises 23-33, show all 5 steps for hypothesis testing:

a) State the hypotheses.

b) Compute the test statistic.

c) Compute the critical value or p-value.

d) State the decision.

e) Write a summary.

23. A manufacturing company knows that their machines produce parts that are defective on occasion. They have 4 machines producing parts and want to test if defective parts are dependent on the machine that produced it. They take a random sample of 300 parts and find the following results. Test at the 0.05 level of significance.

clipboard_e0578b19f4c59b98cae13037881c49394.png

24. The sample data below show the number of companies providing health insurance for small, medium and large companies. Test to see whether health insurance coverage and company size are dependent. Use \(\alpha\) = 0.01.

clipboard_e3f73a0fb6beb2eec65477cd6f10ef02f.png

25. A restaurant chain that has 3 locations in Portland is trying to determine which of their 3 locations they should keep open on New Year’s Eve. They survey a random sample of customers at each location and ask each whether they plan to go out to eat on New Year’s Eve. The results are below. Run a test for independence to decide if the proportion of customers who will go out to eat on New Year’s Eve is dependent on location. Use \(\alpha\) = 0.05.

clipboard_e068ad895bfe7fc35d37ddb34ba93c769.png

26. The following sample was collected during registration at a large middle school. At the 0.05 level of significance, can it be concluded that level of math is dependent on grade level?

clipboard_ecbbed50827bdf03ca7425a98e80b2fe3.png

27. A high school offers math placement exams for incoming freshmen to place students into the appropriate math class during their freshman year. Three middle schools were sampled and the following pass/fail results were found. Test to see if the math placement exam result and the school that students attend are dependent at the 0.10 level of significance.

clipboard_e306f6ad66a974b7777ac1f60148bddee.png

28. A public opinion poll surveyed a simple random sample of 500 voters in Oregon. The respondents were asked which political party they identified with most and were categorized by residence. Results are shown below. Decide if voting preference is dependent on location of residence. Let \(\alpha\) = 0.05.

clipboard_e9df5c09bc0ddbec28d214fa1df3dc78b.png

29. A university changed to a new learning management system (LMS) during the past school year. The school wants to find out how it is working for the different departments – the results in preference found from a survey are below. Test to see if the department and LMS preference are dependent at \(\alpha\) = 0.05.

clipboard_ebb0050d692f6faf6baddf1798b6f441b.png

30. The medal count for the 2018 winter Olympics is recorded below. Run an independence test to find out if the medal won is dependent on country. Use \(\alpha\) = 0.10.

clipboard_e57ccc7dfb858b2c6d1d33e267bf515d5.png

31. An electronics store has 4 branches in a large city. They are curious if sales in any particular department are different depending on location. They take a random sample of purchases throughout the 4 branches – the results are recorded below. Test to see if the type of electronic device and store branch are dependent at the 0.05 level of significance.

clipboard_e6cac68aa76a1d06732dc6b710f3cdd47.png

32. A high school runs a survey asking students if they participate in sports. The results are found below. Test to see if there is a relationship between participating in sports and year in school at \(\alpha\) = 0.05.

clipboard_e1c8250e738f93d9dc34a8856351cfb77.png

33. A 4-year college is curious which of their students hold down a job while also attending school. They poll the students and find the results below. Test to see if there is a relationship between college students having a job and year in school. Use \(\alpha\) = 0.05.

clipboard_e63f3a1cce75ad38bfda8dc83fb800e43.png


Answers to Odd Numbered Exercises

1) d

3) b & c

5) \(H_{0}: p_{1} = 0.6, p_{2} = 0.25, p_{3} = 0.15\); \(H_{1}:\) At least one proportion is different. \(\chi^{2} = 86.5529\); p-value \(=1.604 \times 10^{-19} = 0\); reject \(H_{0}\). There is enough evidence to support the claim that the distribution is different than expected. There were more students than expected that would read the text online.

7) \(H_{0}: p_{1} = 0.301, p_{2} = 0.176, p_{3} = 0.125, p_{4} = 0.097, p_{5} = 0.079, p_{6} = 0.067, p_{7} = 0.058, p_{8} = 0.051, p_{9} = 0.046\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) =11.8466; CV = 15.5073; do not reject \(H_{0}\). There is no evidence of tax fraud so law enforcement officials should not pursue the case.

9) \(H_{0}: p_{1} = 0.25, p_{2} = 0.25, p_{3} = 0.25, p_{4} = 0.25\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) = 3.16; p-value = 0.3676; do not eject \(H_{0}\). There is not enough evidence to support the claim that preference among the four display designs.

11) \(H_{0}: p_{1} = 0.25, p_{2} = 0.25, p_{3} = 0.25, p_{4} = 0.25\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) = 2.64; p-value = 0.4505; do not reject \(H_{0}\). There is not enough evidence to support the claim that car accidents are not equally distributed throughout the year.

13) \(H_{0}: p_{1} = 0.27, p_{2} = 0.32, p_{3} = 0.41\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) = 8.352; p-value = 0.0154; reject \(H_{0}\). There is enough evidence to support the claim that there a significant difference in where young adults lived in 2000 versus 2008. There are fewer young adults living at home than expected.

15) \(H_{0}: p_{1} = 0.727, p_{2} = 0.197, p_{3} = 0.048, p_{4} = 0.028\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) = 20.0291; p-value = 0.0002; reject H0. There is enough evidence to support the claim that the distribution of Oregon residents is different now compared to 1990. There were more Oregonians in central Oregon than expected.

17) \(H_{0}: p_{1} = 0.1, p_{2} = 0.15, p_{3} = 0.34, p_{4} = 0.4\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) = 1.9196; p-value = 0.5893; do not reject \(H_{0}\). There is not enough evidence to support the claim that the Mr. Mendoza’s course evaluation scores are different compared to the rest of the History Department’s evaluations.

19) \(H_{0}: p_{1} = 0.42, p_{2} = 0.31, p_{3} = 0.16, p_{4} = 0.11\); \(H_{1}:\) At least one proportion is different. \(\chi^{2}\) = 7.6986; p-value = 0.05267; do not reject H0. There is not enough evidence to support the claim that the patients who took the medicine healed at a different rate than these percentages.

21) c

23) \(H_{0}:\) The number of defective parts is independent on the machine that produced it. \(H_{1}:\) The number of defective parts is dependent on the machine that produced it. \(\chi^{2}\) = 2.3536; p-value = 0.5023; do not reject H0. There is not enough evidence to support the claim that the number of defective parts is dependent on the machine that produced it.

25) \(H_{0}:\) The proportion of customers who will go out to eat on New Year’s Eve is independent of location. \(H_{1}:\) The proportion of customers who will go out to eat on New Year’s Eve is dependent on location. \(\chi^{2}\) = 2.2772; p-value = 0.3203; do not reject \(H_{0}\). There is not enough evidence to support the claim that the proportion of customers who will go out to eat on New Year’s Eve is dependent on location.

27) \(H_{0}:\) The math placement exam and where students are placed are independent. \(H_{1}:\) The math placement exam and which middle school students attend are dependent. \(\chi^{2}\) = 0.1642; p-value = 0.9212; do not reject \(H_{0}\). There is not enough evidence to support the claim that the math placement exam and which middle school students attend are dependent.

29) \(H_{0}:\) Department and LMS preference are independent. \(H_{1}:\) Department and LMS preference are dependent. \(\chi^{2}\) = 24.7778; p-value = 0.000056; reject \(H_{0}\). There is enough evidence to support the claim that department and LMS preference are dependent.

31) \(H_{0}:\) Type of electronic device and store branch are dependent. \(H_{1}:\) Type of electronic device and store branch are dependent. \(\chi^{2}\) = 7.4224; p-value = 0.8285; do not reject \(H_{0}\). There is not enough evidence to support the claim that type of electronic device and store branch are dependent.

33) \(H_{0}:\) Having a job in college and year in school are not related. \(H_{1}:\) Having a job in college and year in school are related. \(\chi^{2}\) = 20.8875; p-value = 0.0001; reject \(H_{0}\). There is enough evidence to support the claim that having a job in college and year in school are related.

From Mostly Harmless Statistics by Rachel L. Webb, adapted from LibreTexts. Licensed CC BY-SA 4.0. XYZ Homework OER web edition, adapted with 7 verified corrections (see errata).