12 - Inference for Two-Way Tables

Alex John Quijano

11/15/2021

Previously on Inference…

Inference on Two-Way Tables

Today, we will discuss the following:

The Chi-Squared Test for Independence (1/2)

The Chi-Squared Test for Independence (1/2)

Computing the \(\chi^2\) statistic - Expected Frequency (1/3)

Grade Popular Sports Total
4th \(\color{blue}{63}\) \(\color{orange}{31}\) 23 119
5th 88 55 33 176
6th 96 55 \(\color{red}{32}\) 183
Total 247 141 90 478

Note: Color corresponds to the cell and we are rounding to the nearest integer for computing the expected frequencies.

\[\color{blue}{E_{4th,Grade} = \frac{(119)(247)}{478} = 61}\] \[\color{orange}{E_{4th,Popular} = \frac{(119)(141)}{478} = 35}\] \[\vdots\] \[\color{red}{E_{6th,Sports} = \frac{(183)(90)}{478} = 34}\]

Computing the \(\chi^2\) statistic - Expected Frequency (2/3)

Grade Popular Sports Total
4th 63 31 23 119
5th 88 \(\color{green}{55}\) 33 176
6th 96 55 32 183
Total 247 141 90 478

Computing the \(\chi^2\) statistic - Expected Frequency (3/3)

Grade Popular Sports Total
4th 63 \(\color{blue}{[61]}\) 31 \(\color{blue}{[35]}\) 23 \(\color{blue}{[23]}\) 119
5th 88 \(\color{blue}{[91]}\) 55 \(\color{blue}{[52]}\) 33 \(\color{blue}{[33]}\) 176
6th 96 \(\color{blue}{[95]}\) 55 \(\color{blue}{[54]}\) 32 \(\color{blue}{[34]}\) 183
Total 247 141 90 478

Computing the \(\chi^2\) statistic

Computing the p-value

Conclusion

10.10-Minute Activity (1/2)

The problem shown below was taken and slightly modified from your textbook OpenIntro: Introduction to Modern Statistics Section 18.4. Consider the research study described below.

Coffee and Depression.

Researchers conducted a study investigating the relationship between caffeinated coffee consumption and risk of depression in women. They collected data on 50,739 women free of depression symptoms at the start of the study in the year 1996, and these women were followed through 2006. The researchers used questionnaires to collect data on caffeinated coffee consumption, asked each individual about physician- diagnosed depression, and also asked about the use of antidepressants. The table below shows the distribution of incidences of depression by amount of caffeinated coffee consumption. Lucas et al. 2011

Caffeinated coffee consumption
Clinical depression 1 cup / week or fewer 2-6 cups / week 1 cups / day 2-3 cups / day 4 cups / day or more Total
Yes 670 ___ 905 564 95 2,607
No 11,545 6,244 16,329 11,726 2,288 48,132
Total 12,215 6,617 17,234 12,290 2,383 50,739
  1. Compute the test statistic. What is the p-value?

  2. What is the conclusion of the hypothesis test?

10:10

10.10-Minute Activity (1/2)

Summary

Today, we discussed the following:

Next, we will discuss:

In lab, we will work on: