Chi square test EN - pdmoerland/wiki-biostatistiek-bilingual GitHub Wiki
Deze pagina lezen in het Nederlands.
Author: dr. ir. N. van Geloven
AuthorshipThis page was translated from the Dutch-language original using AI and has not been fully reviewed. Where the two differ, the Dutch version takes precedence.
- When do I use the Chi-square test?
- How do I test the difference between groups for a 0-1-2 outcome?
- How do I test the difference between groups for an outcome on a 1-5 scale?
- Where do I find the Chi-square test in SPSS?
- References
The Chi-square test assesses whether the difference between two (or more) proportions genuinely exists or is merely "due to chance".
The Chi-square test can be used to test whether the difference between two proportions in a classic 2x2 table is significant. Traditionally, Fisher's exact test is chosen instead of a Chi-square test when there are low numbers (observed count ~<10 or expected count <5) in the 2x2 table. The Chi-square test is then no longer accurate. Because Fisher's exact test can be calculated just as quickly as a Chi-square test in current statistical packages, there is no longer any objection to always using this exact test (Chi-square uses an approximation) when analyzing a 2x2 (or an m x n) table. In general, the Chi-square test will be less conservative (more likely to reach significance) than Fisher's exact test.
Example of the use of the Chi-square test:
| Table 1. Baseline characteristics of the patients | |||
|---|---|---|---|
| Variable* | Treated Group | Placebo Group | p-value** |
| Gender - Male | 61% (146/240) | 69% (161/234) | 0.07 |
| Family history disease | 21% (50/240) | 15% (36/234) | 0.12 |
| *Variables are denoted as percentage (cases/n). **Group differences were tested with the chi-square test. | |||
I have two groups: allergic patients (n=52) versus healthy controls (n=14). The group of allergic patients is then subdivided into 4 subgroups, which I want to compare with each other and with the healthy controls. The outcome is expressed as the degree of staining on a 3-point scale (0 = no staining, 1 = some staining, 2 = extensive staining). Which analysis can I use?
For the 3-point scale you could use a Chi-square test. This can be done both for the 'overall' comparison across the 5(?) groups and when zooming in on 2 groups against each other. Something else you could consider is using a chi-square test for trend. With this, you look at differences in one direction, for example if among allergic patients 50% have no staining and 50% have extensive staining, while among healthy controls 100% have some staining, then a regular chi-square test will detect a difference here, but a chi-square test for trend will not, because it does not see a consistent increase or decrease in staining. If you also want to use the chi-square test for trend for the comparison across the 5(?) subgroups, then those subgroups also need to have a logical ordering, e.g. from mildly to highly allergic. The result of the chi-square test for trend can be found in SPSS under 'linear by linear'.
I find it difficult to assess whether the outcomes of the individual questions are normally distributed. All items have an outcome on a 5-point scale. Which test can I use to compare these items between the two groups?
An outcome that can only take values 1-5 cannot really be assumed to be normally distributed. A Mann-Whitney U test could work, but due to the limited number of response options it also has little discriminating power. If there are sufficient numbers in the various cells of the 2x5 table, it is an option to do a chi-square test for trend for the per-item comparisons (between 2 groups, as I understand it).
You will find the test in SPSS under Analyze->Descriptive Statistics->Crosstabs. Under the "Statistics..." button, check Chi-square. See also this IBM help page for information on performing a Chi-square test for trend in SPSS.
- Agresti A (1990) Categorical Data Analysis. John Wiley & sons, New York.
- A/B testing and Pearson's chi-squared test of independence on TheStatsGeek.com. A clear explanation (in English) of the Chi-square test, including an example of how to perform this test in R.
Finished reading? You can go to the Overview of all topics, or to Choosing a test for help picking a suitable test or analysis. Want to learn more about biostatistics? Then follow the AMC e-learning Practical Biostatistics. Did you find something on these pages that isn't correct? Does a link not work? Or would you like to contribute to the wiki? Then get in touch with us.
This biostatistics wiki is an initiative of the former statistics helpdesk of Amsterdam UMC, location AMC. Amsterdam UMC staff can request statistical support via intranet.