# Pearson's chi-squared test

The **Pearson's** **chi-squared test** is one of the most common statistical tests found in radiology research. It is a type of non-parametric test, used with two categorical variables (not continuous variables).

#### Concept

The heart of the chi-squared test is a 2 x 2 contingency table.

We usually have a set of patients and a set of controls. We then want to test whether our independent variable is associated with our dependent variable (or not).

- first we fill out the 2 x 2 table as if there were no association ("expected values", E
_{i}). Divide the cases and controls (proportionally) into the four cells of the contingency table. - then fill in the actual values that you found from your study ("observed values", O
_{i}). - this is the [O
_{i}- E_{i}] per cell.

Next, square these [O_{i} - E_{i}] values so that the sum does not equal zero.

Finally, divide each [O_{i} - E_{i}] value by E_{i}. This move accounts for the distribution of values around the mean (sort of the standard deviation). The reason this is legitimate is because the values in the table follow a Poisson distribution.

The final result of this manoeuvre is

χ^{2} = Σ ([O_{i} - E_{i}]^{2} / E_{i})

This results in a chi-squared number (χ^{2}), which can be checked in a table for significance. The degree of freedom for a 2 x 2 table is 1. If the χ^{2} value is above the level in the table, then we can reject the null hypothesis (no association between the variables).

#### Points

- chi-squared tests work with categorical variables (e.g. disease vs no disease, got imaging test vs did not get imaging test, etc)
- it is not meant for continuous variables (e.g. length, time, radiation dose, etc)

- chi-squared tests work best with a reasonably high n
- for low n studies, consider other non-parametric tests that compare medians, not means

#### Related articles

##### Research

- clinical trials
- descriptive studies
- statistics
- concepts
- analyses of variance
- regression
- nonparametric statistics
- bias