 The chi-square test

We are interested in examining whether the alignment status (presence or absence) is associated with the wire type (A or B). This association can be tested by using a chi-square (χ 2 ) test. This test gives only evidence of an association or no association, but it does not produce effect estimates and confidence intervals. In other words, it does not tell us the effect (risk ratio or odds ratio).

Under the null hypothesis, there is no association between these 2 variables. To test this hypothesis, first, we need to calculate the expected frequencies in each cell of the 2 × 2 table ( Table I ).

Table I
The 2 × 2 table
Wire Total
A B
Alignment
Yes 23 19 42
No 8 11 19
Total 31 30 61

For example, for the first row, the expected frequencies will be the same as the observations if there is no difference in reaching alignment between the wires (null hypothesis). Thus, for the first cell with a frequency of 23, the expected frequency can be calculated as follows.

row total*column total overall total = 42 * 31 61 = 21.3

By completing similarly the expected values in the remaining 3 cells, we arrive at Table II , which shows the expected frequencies under the null hypothesis. The expected frequencies cannot be integers, since they are only averages.

Table II
The 2 × 2 table with expected frequencies
A B Total
Alignment
Yes 23 19 42
Expected 21.3 20.7 42
No 8 11 19
Expected 9.7 9.3 19
Total 31 30 61

In the next step, we decide whether to accept the null hypothesis. To achieve this, we compare how much the observed frequencies deviate from the expected ones. This difference between observed and expected frequencies can be assessed by using a statistical test known as the χ 2 .

The statistical formula for this test is the following

χ 2 = ∑ ( O − E ) 2 E

where O is the observed cell frequency, E is the expected cell frequency, and Σ is the sum of all cells in the table.

According to the χ 2 statistic, we can conclude the following.

• 1.

If there is a large difference between the observed and expected values, then the value of the χ 2 will be large, and the data would not support the null hypothesis.

• 2.

If there is a small difference between the observed and expected values, then the value of the χ 2 will be small, and the data will support the null hypothesis.

The total value of 0.88 is the χ 2 test statistic Table III that we will use to determine the P value.

P − value = 0.36