ChiSquare  Test for Homogeneity
A chisquare test for homogeneity is a test to see if different distributions are similar to each other.
Steps:
1. Define your hypotheses
H_{o}: The distributions are the same among all the given populations.
H_{a}: The distributions differ among all the given populations.
2. Find the expected counts:

For each cell, multiply the sum of the column it is in and the sum of the row it is in, and then divide by the total in all cells, or the sample size (row total)(column total)sample size
Example Problem:
A company wants to examine the homogeneity of auto types purchased among three states. Is there sufficient evidence that the auto types purchased among the three states is different? The data is below.
California 
Massachusetts 
Georgia 

Car 
90 
97 
61 
SUV 
81 
92 
54 

Define your hypotheses

Ho: The distributions of auto types purchased is the same for all three states.

HA:The distributions of auto types purchased differs among all three states.


Find expected counts
For each cell, multiply the sum of the column it is in and the sum of the row it is in, and then divide by the total in all cells (row total)(column total)sample size
Sample Calculations:
California column subtotal: 90+81=171
Car row subtotal: 90+97+61=248
Total: 90+97+61+81+92+54=475
First cell’s expected count: (171)(248)/475=89.28 (repeat for all other columns)
Key:
OBSERVED / EXPECTED
California 
Massachusetts 
Georgia 
Row Total 

Car 
90 / 89.28 
97 / 98.67 
61 / 60.04 
248 
SUV 
81 / 81.72 
92 / 91.32 
54 / 54.96 
227 
Column Total 
171 
189 
115 
Total: 475 
*Note: do not round the number of expected counts

Check conditions

Data are counts ✓

SRS ✓

assumed


N10n (the population size is at least 10x greater than the sample size) ✓

N10(475) → assumed


All of the expected counts are at least 5 ✓


Find the chisquare statistic

Use 2=(observedexpected)2expected
2=(9089.28)289.28+(9798.67)298.67+(6160.04)260.04+(8181.72)281.72+(9291.32)291.32+(5454.96)254.96= 0.078


Find the degrees of freedom

Degrees of freedom (df) = (# of rows  1)(# of columns  1)
(21)(31) = 2


Find the pvalue
> # ENTER THE DATA BY ROW > car = c(90, 97, 61) > suv = c(81, 92, 54) > > # USE THE rbind FUNCTION TO BIND THE ROWS > data.table = rbind(car, suv) > > data.table [,1] [,2] [,3] car 90 97 61 suv 81 92 54 > > # RUN CHISQUARE TEST > chisq.test(data.table) Pearson's Chisquared test data: data.table Xsquared = 0.1038, df = 2, pvalue = 0.9494
tTAB 2 CONTENT HERE

Use your calculator DISTR [8]2cdf(

TI83: 2cdf (chisquare value, any large number, df)
2cdf (0.078, e^99, 2) → pvalue=0.95



TI84:
lower: 0.078
upper: 9999
df: 2
pvalue=0.95


Generate your conclusion

I calculated a pvalue of 0.95, which is greater than the assumed significance level of 0.05. Therefore, I fail to reject the null hypothesis, and the data does not support the claim that the distribution of auto types purchased differs among all three states.

Chi Squared Test of Homogeneity
Introduction
The Chi Squared Test of Homogeneity is very similar to the Chi Squared Test of Association except that the data comes from simple random samples taken from multiple separate populations.
Example
You want to determine if there is any difference in distributions among political affiliation as it applies to gun control. You take separate samples of the Democrat population, Independent population, and Republican population. The data is shown below.
Democrat  Independent  Republican  
Yes  20  20  5 
No  10  18  30 
Step 1: Name Test: ChiSquared Test of Homogeneity
Step 2: Define Test:
H_{o}: There is no difference in distributions among political affiliation as it applies to gun control.
H_{A}: There is a difference in distributions among political affiliation as it applies to gun control.
Step 3: Assume is true and define its normal distribution. Then check for specific conditions which vary depending on the type of hypothesis test.
1. Data from multiple independent random samples
2. N_{1} > 10n_{1} .... N_{k} > 10n_{k} (k = # of populations)
3. All expected counts greater than 5
Step 4: Using the normal distribution, calculate the test statistics and pvalue.
To solve for X^{2} use the EXACT SAME process used to solve for the test of association!
Don't forget to state your conclusion afterward.