## Chi-Squared Test of Homogeneity

**Overview:**

The chi-squared test of homogeneity tests if two or more populations could have the same distribution of a single categorical variable.

**Hypothesis**

The null hypothesis states that

**each population**has the same distribution of observations. While the alternative hypothesis states that it doesn’t have the same distribution. These hypotheses are written in words, not symbols.

**Assumptions and Conditions**

- Randomization Condition: The data being collected must be random.
- Expected Cell Frequency Condition: We would expect to have at least
**5**individuals or entries in each cell. So when you do the T.I. Tip, you would go back to matrix and click 2: [B] and press enter. If the numbers are all above 5 then it should pass this condition.

**Mechanics**

χ²: Chi-squared test statistic is when you add the sum of the squares of the deviation between the observed and expected counts divided by the expected counts.

Degrees of Freedom:

*Degrees of Freedom is needed to find a P-value for the chi-square statistic.

2nd › Matrix › Edit › Type the Dimensions and the observed counts into Matrix A.

Stat › Tests › C: χ²-Test

Standardized Residual: If you reject the null hypothesis it is always good to check the residual.

*n*is the number of categories*(R-1)(C-1) R*= Row*C*= Column*Degrees of Freedom is needed to find a P-value for the chi-square statistic.

**TI Tip**2nd › Matrix › Edit › Type the Dimensions and the observed counts into Matrix A.

Stat › Tests › C: χ²-Test

Standardized Residual: If you reject the null hypothesis it is always good to check the residual.

We can see Matrix B (with expected cell counts) to check the Expected Cell Frequency Condition.

In your conclusion you would either reject or fail to reject your null hypothesis. If the p-value is higher than the alpha level (0.05) then you would fail to reject the null hypothesis and there is not enough evidence to support that they have the same distribution. If the p-value is lower than the alpha level, then you would reject the null and there is enough evidence to support it.

**Conclusion**In your conclusion you would either reject or fail to reject your null hypothesis. If the p-value is higher than the alpha level (0.05) then you would fail to reject the null hypothesis and there is not enough evidence to support that they have the same distribution. If the p-value is lower than the alpha level, then you would reject the null and there is enough evidence to support it.

**Example:** a) This is an experiment because there are different type of drinks and they use a control.

b) This would be a test of homogeneity because they do not ask whether the juice is independent of the infection. It wouldn’t be a goodness-of-fit due to the fact that it uses 3 categorical variables.

c)H0: Rate of urinary tract infection is the same for all three groups. HA: Rate of urinary tract infection is different between the groups.

d) The data consists of counts, the women were randomly assigned to drinks, using the matrix all expected counts are above 5.

e) Degree of Freedom (3-1)(2-1) = 2

f) Using the x2 – Test from the Matrix we should get x2 = 7.776 and p-value = .020.

g) With a p-value of .020, which is less than , we reject the null hypothesis and there is enough evidence that there is a difference in urinary tract infection rates between the drinks.

b) This would be a test of homogeneity because they do not ask whether the juice is independent of the infection. It wouldn’t be a goodness-of-fit due to the fact that it uses 3 categorical variables.

c)H0: Rate of urinary tract infection is the same for all three groups. HA: Rate of urinary tract infection is different between the groups.

d) The data consists of counts, the women were randomly assigned to drinks, using the matrix all expected counts are above 5.

e) Degree of Freedom (3-1)(2-1) = 2

f) Using the x2 – Test from the Matrix we should get x2 = 7.776 and p-value = .020.

g) With a p-value of .020, which is less than , we reject the null hypothesis and there is enough evidence that there is a difference in urinary tract infection rates between the drinks.