Selecting Chi-Square Procedures
Chi-square (χ²) procedures are among the most versatile tools in statistics, allowing us to draw conclusions about categorical data — data organized into groups or categories rather than measured on a numerical scale. Before performing any chi-square test, however, you must correctly identify which of the three main procedures applies to your situation. Choosing the wrong test leads to invalid conclusions, no matter how carefully you carry out the arithmetic. The three chi-square procedures covered in introductory statistics are: the Goodness-of-Fit test, used when you have one categorical variable and want to compare its observed distribution to a claimed distribution; the Test of Homogeneity, used when you want to compare the distribution of one categorical variable across two or more independent populations or treatments; and the Test of Independence (also called the Test of Association), used when you have two categorical variables measured on the same group of individuals and want to determine whether the variables are related. All three procedures share the same test statistic formula and chi-square distribution, which makes careful selection even more critical. The key to selecting the right procedure lies in asking two diagnostic questions: How many categorical variables are involved, and how was the data collected? Answering these questions precisely will guide you to the correct test every time and ensure that your conditions, hypotheses, and conclusions are all properly stated.
- Count the Number of Categorical Variables
- Examine the Data Collection Method
- Write Appropriate Hypotheses
- Verify Conditions Before Proceeding
- Compute the Test Statistic and Find the P-value
Count the Number of Categorical Variables
Ask yourself: how many categorical variables are being studied? If you have exactly one categorical variable and you are comparing its observed frequency distribution to a theoretical or claimed distribution, you are looking at a Goodness-of-Fit test. If you have two categorical variables, you need to move to Step 2 to distinguish between Homogeneity and Independence.
Examine the Data Collection Method
For two categorical variables, identify how the data were collected. If researchers drew separate, independent random samples from two or more distinct populations (or assigned subjects to treatment groups), and measured one categorical response variable, use the Test of Homogeneity. The question is: 'Are the distributions of this one variable the same (homogeneous) across populations?' If researchers drew one random sample from a single population and recorded two categorical variables on each individual, use the Test of Independence (Association). The question is: 'Are these two variables related or independent within the population?'
Write Appropriate Hypotheses
Goodness-of-Fit: H₀: The population distribution matches the claimed proportions p₁, p₂, …, pₖ. Hₐ: At least one proportion differs. Test of Homogeneity: H₀: The distribution of the categorical variable is the same across all populations. Hₐ: The distributions differ for at least one population. Test of Independence: H₀: The two categorical variables are independent (not associated) in the population. Hₐ: The two variables are associated. Note that Homogeneity and Independence share identical mathematical mechanics — the distinction is conceptual and reflects the study design.
Verify Conditions Before Proceeding
All three chi-square procedures share the same conditions: (1) Random — data must come from a random sample or randomized experiment. (2) Independence — individual observations must be independent; if sampling without replacement, the sample size n must be no more than 10% of the population. (3) Large Counts — every expected cell count must be at least 5. The expected count for any cell is calculated as E = (row total × column total) / n for two-way tables, or E = n · pᵢ for goodness-of-fit tests. If any expected count falls below 5, the chi-square approximation is unreliable and you should combine categories or use an alternative test.
Compute the Test Statistic and Find the P-value
Once you have selected the correct procedure and verified the conditions, compute the chi-square statistic using χ² = Σ[(O − E)² / E], where O is the observed count and E is the expected count for each cell or category. The degrees of freedom depend on the procedure: for Goodness-of-Fit, df = k − 1 (where k is the number of categories); for two-way table tests (both Homogeneity and Independence), df = (r − 1)(c − 1) where r is the number of rows and c is the number of columns. The P-value is always the area to the right of the computed χ² value under the chi-square distribution with the appropriate degrees of freedom, since extreme deviations from expected values produce large positive χ² values.
The Key Equation
- \chi^2 — Chi-square statistic (dimensionless): The test statistic that measures how far the observed data deviate from what is expected under H₀; larger values provide more evidence against H₀.
- O — Observed count (count): The actual frequency recorded in a cell or category from the sample data.
- E — Expected count (count): The frequency predicted by the null hypothesis; for two-way tables E = (row total × column total) / n, and for goodness-of-fit E = n · pᵢ.
Worked Example
Problem. A school counselor surveys 200 randomly selected students and records their grade level (9th, 10th, 11th, 12th) and their preferred study environment (Library, Home, Café). She wants to know whether preferred study environment is related to grade level. Which chi-square procedure should she use, and what are the degrees of freedom? She also wants to check the Large Counts condition for the cell corresponding to 9th graders who prefer the Library, given that 60 students are in 9th grade and 90 students prefer the Library.
Answer. Use the Chi-Square Test of Independence with df = 6. The expected count for the 9th-grade/Library cell is 27, which satisfies the Large Counts condition.
Origins · 1 minKarl Pearson and how this was discovered
Karl Pearson introduced the chi-square goodness-of-fit test in his landmark 1900 paper, deriving the χ² statistic and its associated distribution. This was one of the first rigorous hypothesis tests ever published, and the Pearson chi-square statistic remains the foundation of all the chi-square inference procedures taught today. Pearson founded the world's first university statistics department at University College London in 1911 and coined the term 'standard deviation,' yet he famously refused to accept Ronald Fisher's later improvements to his own work, leading to a bitter scientific rivalry that lasted decades.
Related Concepts
- Chi-Square Goodness-of-Fit Test — The Goodness-of-Fit test is one of the three procedures you must be able to select among; understanding it deeply supports correct procedure selection.
- Chi-Square Test of Homogeneity — Homogeneity is easily confused with Independence; mastering its design features (multiple independent samples) reinforces selection skill.
- Chi-Square Test of Independence — Independence applies when one sample yields two categorical variables — the most common two-variable chi-square scenario in practice.
- Expected Counts in Two-Way Tables — Computing expected counts correctly is required to verify the Large Counts condition and to calculate the chi-square statistic regardless of which procedure is selected.
- P-Values and Statistical Significance — All chi-square procedures culminate in a P-value interpreted against a significance level; a solid understanding of P-values is essential for drawing correct conclusions.