Skip to main content

Section 24.5 Summary of Chi-squared Tests

Summary of Chi-squared Tests.

Test of homogeneity: Data are independent random samples from \(I\) different populations/processes or from a randomized experiment with \(I\) treatments.
Β Β \(H_0\!: \pi_1 = \cdots = \pi_I\) where \(\pi_i\) is the probability of success for population (treatment) \(i\text{.}\)
Β Β \(H_a\!:\) at least \(\pi_i\) differs from the rest.
Β Β \(H_0\text{:}\) the response variable distributions are the same in each population (treatment).
Β Β \(H_a\text{:}\) at least one population (treatment) distribution differs from the others.
Test of association: Data are one random sample from a large population, cross-classified by two categorical variables.
Β Β \(H_0\!:\) no association between variable 1 and variable 2 in the population.
Β Β \(H_a\!:\) there is an association between variable 1 and variable 2.
Chi-square Statistic: \(\chi^2 = \sum_{i=1}^{r} \sum_{j=1}^{c} \frac{(Observed_{ij}-Expected_{ij})^2}{Expected_{ij}}\)
Chi-square distribution used for upper-tail p-values
The (upper tail) p-value is calculated from the chi-square distribution with \((r - 1)(c - 1)\) degrees of freedom.
Technical conditions: at least 80% of expected counts are at least 5, and all expected counts are at least 1.
Follow-up analysis: After computing the p-value, examine the largest cell contributions or residuals to describe where observed counts differ most from expected counts.

Technology Instructions.

Use the hint links below to reveal software-specific instructions.
Hint 1. Applet Instructions
  • You can paste in raw data or the two way table. Remember to use one-word variable names and categories.
  • Check the Show Table and Show \(X^2\) output boxes.
Hint 2. R Instructions
  • Create a matrix of the observed counts and use chisq.test(matrix).
  • To access the expected counts and (unsquared) chi-squared contributions use chisq.test(matrix)$expected and chisq.test(matrix)$residuals.
Hint 3. JMP Instructions
  • With two nominal columns (and perhaps a column of counts), choose Analyze > Fit Y by X. Report the Pearson chi-square and p-value.
  • Use the Contingency Table hot spot to turn on the Cell Chi Square values.
JMP data page layout for chi-square test setup
You have attempted of activities on this page.