You are on page 1of 2

STATISTICS AND RESEARCH DESIGN

The chi-square test


Nikolaos Pandis, Associate Editor of Statistics and Research Design
Bern, Switzerland, and Corfu, Greece

W
e are interested in examining whether the
Table I. The 2 3 2 table
alignment status (presence or absence) is
associated with the wire type (A or B). This as- Wire
sociation can be tested by using a chi-square (c2) test. A B Total
This test gives only evidence of an association or no as- Alignment
sociation, but it does not produce effect estimates and
Yes 23 19 42
confidence intervals. In other words, it does not tell us No 8 11 19
the effect (risk ratio or odds ratio). Total 31 30 61
Under the null hypothesis, there is no association be-
tween these 2 variables. To test this hypothesis, first, we
need to calculate the expected frequencies in each cell of
the 2 3 2 table (Table I). Table II. The 2 3 2 table with expected frequencies
For example, for the first row, the expected
frequencies will be the same as the observations if there A B Total
Alignment
is no difference in reaching alignment between the wires
(null hypothesis). Thus, for the first cell with a frequency Yes 23 19 42
Expected 21.3 20.7 42
of 23, the expected frequency can be calculated as
No 8 11 19
follows.
Expected 9.7 9.3 19
row total  column total 4231 Total 31 30 61
5 5 21:3 (1)
overall total 61
By completing similarly the expected values in the
remaining 3 cells, we arrive at Table II, which shows
According to the c2 statistic, we can conclude the
the expected frequencies under the null hypothesis.
following.
The expected frequencies cannot be integers, since
they are only averages. 1. If there is a large difference between the observed
In the next step, we decide whether to accept the null and expected values, then the value of the c2 will
hypothesis. To achieve this, we compare how much the be large, and the data would not support the null
observed frequencies deviate from the expected ones. hypothesis.
This difference between observed and expected fre- 2. If there is a small difference between the observed and
quencies can be assessed by using a statistical test expected values, then the value of the c2 will be small,
known as the c2. and the data will support the null hypothesis.
The statistical formula for this test is the following
The total value of 0.88 is the c2 test statistic Table III
X ðO  EÞ2 that we will use to determine the P value.
c2 5 (2)
E P  value 5 0:36 (3)
where O is the observed cell frequency, E is the expected Hence, the null hypothesis is accepted, since
cell frequency, and S is the sum of all cells in the table. P .0.05. The P value can be calculated in Excel (Micro-
soft, Redmond, Wash) with the formula 1 – CHIS-
Q.DIST(X;df;T), where X is the value of the c2-test, df
Assistant professor, Department of Orthodontics and Dentofacial Orthopedics,
School of Dental Medicine/Medical Faculty, University of Bern, Bern, is degrees of freedom, and T(RUE) corresponds to the
Switzerland; private practice, Corfu, Greece. cumulative c2 distribution.
Am J Orthod Dentofacial Orthop 2016;150:898-9 To find the correct value at the c2 distribution table,
0889-5406/$36.00
Ó 2016 by the American Association of Orthodontists. All rights reserved. we need the degrees of freedom, which are calculated by
http://dx.doi.org/10.1016/j.ajodo.2016.08.009 the following formula: df 5 (r1)*(c1), where c is the
898
Statistics and research design 899

2
Table III. Calculation of the c statistic value Table V. Two-sample test of proportions
Observed Expected Variable Mean 95% CI
frequency frequency A 0.74
Wire Alignment (O) (E) (OE) (OE)2 (OE)2/E
B 0.63
A Yes 23 21.3 1.7 2.89 0.1357
Difference 0.11 0.12, 0.34
A No 8 9.7 1.7 2.89 0.2979
z 5 0.94, P 5 0.36
B Yes 19 20.7 1.7 2.89 0.1396
B No 11 9.3 1.7 2.89 0.3105
Total 0.8837

2
Table VI. Guidelines for validity of the c test
2
Table IV. Part of the c table with percentage points c2 test is valid if If c2 test is not valid
of the c2 distribution2 2 3 2 tables Total sample size .40 Use Fisher exact test
Total sample size n is
Degrees of Tail probability (P) 20 \ n \ 40, and
freedom the smallest expected
(df) 0.5 0.1 0.05 0.02 0.01 0.001 value is at least 5
1 0.455 2.706 3.841 5.412 6.635 10.827 Higher order No more than 20% Use other tests
2 1.386 4.605 5.991 7.824 9.210 13.815 tables of the expected values
3 2.366 6.251 7.815 9.837 11.345 16.268 are less than 5, and
4 3.357 7.779 9.488 11.668 13.277 18.465 none are less than 1
5 4.351 9.236 11.070 13.388 15.086 20.517 (have empty cells)

number of columns, and r is the number of rows in our The application of the c2 test depends on the sample
2 3 2 table. The df 5 (21)*(21) 5 1. size and the magnitude of the expected frequencies. The
We can inspect the probability for the c2 statistic for latter cannot be less than 5. The assumption for the c2
1 df and alpha 5 5% in Table IV and see that 0.88 cor- test is that the test statistic approximately follows a
responds to a P value between 0.1 and 0.5, and this is c2 distribution. This assumption is reasonable for
not a significant finding as expected. Cross tabulations large samples, but for smaller ones the guidelines in
might include more than 2 rows and columns, and again Table VI can be used.1
a c2 test can be applied.
Please note also that the c2 test for a 2 3 2 table is REFERENCES
similar to the z test for comparing 2 proportions. The
1. Kirkwood BR, Sterne JAC. Essential medical statistics. 2nd ed. Ox-
value z 0.8850.93 is the square root of c2. The test ford, United Kingdom: Blackwell; 2003. p. 168-9.
for proportions is shown in Table V and gives similar 2. Kirkwood BR, Sterne JAC. Essential medical statistics. 2nd ed. Ox-
results as the c2 test. ford, United Kingdom: Blackwell; 2003. p. 476.

American Journal of Orthodontics and Dentofacial Orthopedics November 2016  Vol 150  Issue 5

You might also like