6.3 Chi-Square
6.3 Chi-Square
X2 = ∑ (O-E)2 / E
Df = (r-1)(c-1)
CHI-SQUARE (X2) DISTRIBUTION
Steps in constructing Chi square -test
Steps in constructing Chi square -test
1. Hypotheses
Ho: the 2 criteria are independent (no association)
HA: The 2 criteria are not independent (There is association)
2. Construct the contingency table
3. Calculate the expected frequency for each cell: By
multiplying the corresponding marginal totals of that cell,
and divide it by the sample size.
E = (row total x column total) / grand total
Steps in constructing Chi square -test
4. Calculate the X2 value (calculated X2 c)
✓ X2 = ∑ (O-E)2 / E.
✓ For each cell we will calculate X2 value.
✓ X2 value for all the cells of the contingency table will be
added together to find X2 c.
5. Define the critical value (tabulated X2)
✓ This depends on alpha level of significance and degrees
of freedom. The value will be determined from X2 table
✓ df=(r-1)(c-1) r: no. of row c: no. of column
Chi-Square Table (Tabulated X 2 )
Steps in constructing Chi square -test
6. Conclusion
✓ If the X2 calculated is less than X2 tabulated we accept Ho.
✓ If the X2 calculated is more than X2 tab we reject Ho.
✓ The tabulated X2 for 2x2 table with df=1 and alpha error=
0.05 is equal to (1.96)2 = 3.84.
Notes
SEIL
No %
Low 50 25
Average 110 55
High 40 20
south 44 22
center 96 48
north 60 30
Condiment
Ketchup Mustard Relish Total
Male 15 23 10 48
Gender
Female 25 19 8 52
Total 40 42 18 100
Example. 2
1. The hypotheses are:
Ho :Gender and condiments are independent.
HA : Gender and condiments are not independent.
2. Cross tabulation
Condiment
Ketchup Mustard Relish Total
Male 15 23 10 48
Gender
Female 25 19 8 52
Total 40 42 18 100
Example. 2
3. Now we need to calculate the expected values for each
cell (we have 6 cells):
E = (row total x column total) / grand total
E (C1) = 48*40 / 100 = 19.2 Condiment
Ketchup Mustard Relish Total
Gender
Female C4 C5 C6 52