For a 3-by-4 table, chi-square df is:
Chi-square inference
Compare observed and expected counts to test population independence.
Key ideas
- Independence null
The population conditional distribution of one categorical variable is the same across categories of the other. The alternative is some association.
- Expected counts
Counts implied by independence and the observed marginal totals, calculated separately for every cell.
- Cell contribution
Squared observed-minus-expected difference divided by expected count. All contributions are nonnegative, and their sum is the chi-square statistic.
- Course count condition
The lecture summary requires at least 80% of expected counts to exceed 5 and none below 1. Use independent observations from a suitable random sample; repeated records of the same person are not independent cases.
Formulas
Which procedure?
Newsletter format and renewal
A random sample of 100 subscribers is classified by newsletter format and renewal. Interpret the Pearson test without a continuity correction. This is an original example with composed R output.
tab <- matrix(c(30, 20, 20, 30), nrow = 2, byrow = TRUE)
# rows: Print, Digital; columns: Renew, Do not renew
chisq.test(tab, correct = FALSE)
Pearson's Chi-squared test
data: tab
X-squared = 4, df = 1, p-value = 0.0455
# Expected counts: 25 in each cellEach expected count is (50×50)/100 = 25, so the count condition holds.
Each cell contributes (5 squared)/25 = 1, totaling 4.
p = 0.0455 gives strong evidence of a population association.
Renewal is 30/50 = 60% for Print and 20/50 = 40% for Digital in the sample. These proportions describe the direction; chi-square itself has no sign.
There is strong evidence of an association between newsletter format and renewal in the subscriber population. The observational design does not establish a causal format effect.
Three-question check
A cell has row total 40, column total 30, and n = 120. Its expected count is:
Which count condition matches the course summary?