Chi Square 2 - 2
Chi Square 2 - 2
Assumptions for χ2
2
1. χ works if you have at least 5 counts in each cell.
2. However, all counts ≥ 1 and most (> 75%) of the counts should be ≥ 5.
3. Use chi-square with nominal and discrete-level data.
4. Need independent observations.
Goodness-of-Fit Test
If people cannot tell the difference, or if they have no preference among coffee, we would
expect about 25 people to choose each coffee type.
H0: In the population, there is no preference for any specific coffee type
H1: In the population, one or more coffee types are preferred over the others
(O − E ) 2
x =∑
2
The df for this test are k-1, where k is the number of groups or cells. For this example, k
= 4 and df = 3.
If we look up the values in the chi square table, we find for 3 df:
Because our obtained value χ2 is 38, and is beyond the critical region at the .05 level
of 7.81, we can reject the null and conclude that the 4 types of coffee are not likely to
be equally preferred. That is, there are differences among the 4 types of coffee, with
some selected more often than others and others selected less than would be
expected by chance.
NOTE:
In SPSS, the residuals are based on the difference between the observed (O) and the
expected (E) values. The unstandardized residual is the simple difference of the
observed and expected values.
Unstandardized residual = O - E
The standardized residual is found by dividing the difference of the observed and
expected values by the square root of the expected value.
Standardized residual = O - E / √E
The standardized residual can be interpreted as any standard score. The mean of the
standardized residual is 0 and the standard deviation is 1. Standardized residuals are
calculated for each cell in the design. They are useful in helping to interpret chi-square
tables by providing information about which cells contribute to a significant chi-square.
If the standardized residual is beyond the range of ± 2, then that cell can be considered to
be a major contributor, if it is > +2, or a very weak contributor, if it is beyond -2, to the
overall chi-square value.
The adjusted standardized residuals are standardized residuals that are adjusted for the
row and column totals. The adjusted standardized residual is defined as:
Adjusted standardized residual = O - E / SQRT[nA * nB * (1 - nA/N) * (1 - nB/N) / N]
nA is the row total, nB is the column total, and N is the total number of cases.
Example: Suppose we are interested in attitudes, but we are a newspaper with a limited
amount of time and expertise in attitudinal surveys. So we decide to do an exit survey of
people voting in DeKalb County. We want to know male and female attitudes about
certain issues, so we ask each person exiting the poll to tell us how they voted on three
measures. Alpha = .05.
Male 40 65 55 160
Female 70 50 60 180
Total 110 115 115 340
Expected values
(O-E)2 / E values
Or (2-1) x (3-1) or 2.
Since we stated a χ2 (crit) α =.05 with 2 df, the results are statistically significant and
we reject the H0 because the obtained chi-square value (i.e., 9.20) exceeded the
critical value of 5.99. That is, there was a statistically significant association between
the distribution of choices pertaining to tax increases for schools, for police, and the
banning of hiring preferences for males versus females in DeKalb county.
Confidence Intervals for 2x2 Tables:
P1 (1 − P1 ) P2 (1 − P2 )
(P1 − P2 ) ± Z α +
2 n1 n2
Males P1 = .333; n1 = 120 and Females P2= .276; n2 = 152
For V:
1 df = <.30 is a small ES
1 df = .30 to < .50 is a moderate ES
1 df = > .50 is a large ES
2 df = <.21 is a small ES
2 df = .21 to < .35 is a moderate ES
2 df = > .35 is a large ES
3 df = <.17 is a small ES
3 df = .17 to < .29 is a moderate ES
3 df = > .29 is a large ES
Note 1: For a 2 x 2 table, with nominal x nominal variables, we can use the Phi ES,
where: Φ = SQRT (χ2 / n)
Note 2: For nominal x ordinal variables, use either Phi or Cramér’s V for the ES.
Note 3: For ordinal x ordinal variables, use Gamma for the ES.
Yates’ Correction for Continuity:
• For a χ2 with 1 df, a 2 x 2 table, and has expected frequencies < 5, a correction measure
can be used because of this broken assumption.
• This correction measure should only be used in this, exact situation.
• Yates’ Correction has been noted to be overly conservative in its χ2 value and,
thus, some do not recommend its use.
Example:
Male Female
Female 3 5
Male 10 2
axd=6
b x c = 50
6-50 = -442 X 20 = 38720
a+b=8
c + d = 12
a + c = 13
b+d=7
= 8x12x13x7 = 8736
= 38720 / 8736 = 4.432 Pearson χ2 = 4.43
However, since we have 2 cells with expected frequencies < 5, and we have a 2 x 2
table, we could run a Yates’ Correction on this same data to obtain the “true” χ2 value.
Yates’ Formula:
N(|ad – bc| - N/2)2_______
(a + b)(c + d)(a + c)(b + d)
Assumptions:
1. Dependent measures; same subjects.
2. Two dichotomous measures.
3. n ≥ 10.
Looking at the contingency table below, we see that of the 30 people who received the
newspaper before the phone calling, 20 still retained the paper after the calling, with 10
people who did not. Of the 70 people who did not receive the newspaper before the
phone calling, 50 received the paper after the calling, with 20 who did not.
Post or After
No Paper (-) Have Paper (+)
change no change 30 = A+B
Have Paper (+) 10 A B 20
g Pre or Before
no change change
No Paper (-) 20 C D 50
70 = C+D
30 = A+C B+D = 70
x.201,1 = 6.64
Since we stated a χ2 (crit) α =.01, the results are statistically significant and we reject
the H0 because the obtained chi-square value (i.e., 26.67) exceeded the critical value
of 6.64. That is, the difference in score change was statistically significant between
the before and after conditions, and the phi effect size (.516) for 1 df indicated that
there was a large relationship between score change. Changes were not equal in
both directions with the phone calling initiative allowing for a greater proportional
change in the direction of people obtaining more newspapers.
([ A − D] − 1) 2
χ2 =
A+ D
Post or After
No Paper (-) Have Paper (+)
change no change 30 = A+B
Have Paper (+) 10 A B 20
g Pre or Before
no change change
No Paper (-) 20 C D 50
70 = C+D
30 = A+C B+D = 70
= |10 – 50| = 40 – 1 = 392 = 1521
= 10 + 50 = 60
= 1521 / 60 = 25.35 or x.201,1 = 6.64
Since we stated a χ2 (crit) α =.01, the results are statistically significant and we reject
the H0 because the obtained chi-square value (i.e., 25.35) exceeded the critical value
of 6.64. That is, the difference in score change was statistically significant between
the before and after conditions.
McNemar’s Test for Dependent Samples/Repeated Measures:
Treatment 1
Yes No
5
Yes 17
g Treatment 2 3
15
No
(B − C) 2
McNemar’s Test =
B+C
x.205,1 = 3.84
Since we stated a χ2 (crit) α =.05, the results are statistically significant and we reject
the H0 because the obtained chi-square value (i.e., 5.00) exceeded the critical value
of 3.84. That is, the difference in Yes/No score change was statistically significant
between the Treatment 1 and Treatment 2 conditions, and the phi effect size (.354)
for 1 df indicated that there was a moderate relationship between Yes/No change,
where changes were not equal in both directions.
Treatment 1
Yes No
5
Yes 17
g Treatment 2 3
15
No
([ B − C ] − 1) 2
χ2 =
B+C
= |5 – 15| = 10 – 1 = 92 = 81
= 5 + 15 = 20
= 81 / 20 = 4.05 or x.205,1 = 3.84
Since we stated a χ2 (crit) α =.05, the results are statistically significant and we reject
the H0 because the obtained chi-square value (i.e., 4.05) exceeded the critical value
of 3.84. That is, the difference in Yes/No score change was statistically significant
between the Treatment 1 and Treatment 2 conditions, and the phi effect size (.318)
for 1 df indicated that there was a moderate relationship between Yes/No change,
where changes were not equal in both directions.
Educational
Education
Researcher
! = factorial
• A factorial is the product of all of the whole numbers, except zero, that are less than or
equal to that number.
5! = 5 x 4 x 3 x 2 x 1 = 120 or 3! = 3 x 2 x 1 = 6 or 0! = 1
Example: Let X be an educational journal, either Educational Researcher or Education,
and let Y be the number of articles in each journal pertaining to Reading or Math. So, we
know that Educational Researcher has 5 articles about Reading and 1 concerning Math,
while Education had 0 on Reading and 4 related to Math.
a+b = 5!
c+d = 5!
c+a = 6!
b+d = 4!
= 5!(120) x 5!(120) x 6!(720) x 4!(24) = 248832000
= 10!(3628800) x 5!(120) x 1! x 1! x 4!(24) = 10450944000
= 248832000 / 10450944000
= .023
Since the p-value for the Fisher’s Exact Test = .023, we would conclude that the
distribution in the observed 2 x 2 table at the .05 level is statistically significant and
different from chance. Thus, we reject H0 and can say that there is a statistically
significant association between the journal and type of article.
Below in the table, are some formulas for calculating indices for effect size and measure
of agreement for 2 x 2 tables. SPSS provides the following as choices from its menu:
Yule’s Q (i.e., this is also known as Gamma for ordinal measures), Phi (i.e., for nominal
measures), Contingency Coefficient (i.e., for nominal measures), Somers’ Dxy (i.e., where
x is considered the dependent measure and for ordinal measures), Somers’ Dyx (i.e.,
where y is considered the dependent measure and for ordinal measures), and Kappa (i.e.,
a measure of agreement).