# 16.9: Chi-Square Exercises

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

## Exercise $$\PageIndex{1}$$

Compute the expected frequencies for the following contingency table:

Table $$\PageIndex{1}$$- Contingency Table
Category A Category B
Category C 22 38
Category D 16 14
Table $$\PageIndex{2}$$- Contingency Table with Calculations
Expected Category A Category B Total
Category C $$\frac{(60 \times 38)} {90}=25.33$$ $$\frac{(60 \times 52)}{90}=34.67$$ $$\sum_{Row C} = 60$$
Category D $$\frac{(30 \times 38)}{90}=12.67$$ $$\frac{(30 \times 52)}{90}=17.33$$ $$\sum_{Row D} =30$$
Total $$\sum_{Column A} =38$$ $$\sum_{Column B} =52$$ $$\sum =90$$

Here are some scenarios to practice the full process:

## Exercise $$\PageIndex{2}$$

You hear a lot of people claim that The Empire Strikes Back is the best movie in the original Star Wars trilogy, and you decide to collect some data to demonstrate this empirically. You ask 48 people which of the original movies they liked best; 8 said A New Hope was their favorite, 23 said The Empire Strikes Back was their favorite, and 17 said Return of the Jedi was their favorite. Perform a chi-square test on these data at the .05 level of significance.

Step 1:

• Research Hypothesis: "There is a pattern of relationship such that more people will prefer The Empire Strikes Back than the other two movies.
• Null Hypothesis: “There is no pattern of relationship in preference for one movie,” meaning that about the same amount of people will like each movie.

Step 2: 3 categories (columns) gives $$df = 2$$, $$\chi_{\text {crit }}^{2}=5.991$$.

Step 3: Based on the given frequencies:

Table $$\PageIndex{3}$$- Contingency Table
New Hope Empire Jedi Total
Observed 8 23 17 48
Expected 16 16 16 N/A

$$\chi^{2}=7.13$$.

Step 4: Based on our sample of 48 people, there is a statistically significant difference in the proportion of people who prefer one Star Wars movie over the others, $$\chi^{2}(2)=7.13$$, $$p < .05$$. It does appear that more people like Empire than the other two movies. Which is just silly; the Ewoks were great!

## Exercise $$\PageIndex{3}$$

A university administrator wants to know if there is a difference in proportions of students who go on to grad school across different majors. Use the data below to test whether there is a relation between college major and going to grad school.

Table $$\PageIndex{4}$$- Counts of Graduate School by Major
No Graduate School 15 41 12

Step 1:

• Research Hypothesis: There is a pattern of relationship such that fewer Business majors go to graduate school than other majors.
• Null Hypothesis: There is no pattern of relationship between major and going to graduate school.

Step 2: $$df = 2$$, $$\chi_{\text {crit }}^{2}=5.991$$.

Step 3: Based on the given frequencies:

Table $$\PageIndex{6}$$- Expected Values of Graduate School by Major
$$\chi^{2}=2.09+12.34+4.49+2.33+13.79+5.02=40.05$$.