Does something occur at different rates in different groups? (chi-square, sensitivity, specificity)
In brief
Both columns divide people into groups (2 to 12 levels each); the aim is to check whether the distribution of one depends on the other. With a 2×2 table Statable also shows the odds ratio. If the table is a test against a reference standard (for example screening against diagnosis), the page can read it as diagnostic accuracy under "Is this a test against a reference standard?".
Requirements
- Independent observations, each person in exactly one cell.
- Expected counts: under 5 in at most 20% of the cells, none under 1; Statable shows the expected counts too. If this is violated, Fisher's exact test applies for 2×2 tables.
- Real counts, not percentages or means.
Reading the result
The table compares observed and expected counts. The chi-square test checks how compatible the deviations are with the assumption of no relationship. Cramér's V gives the strength. If the smaller side of the table has 2 levels (e.g. 2×2, 2×4): from about .10 small, .30 medium, .50 large; with 3 levels .07 / .21 / .35; with 4 levels .06 / .17 / .29 (Cohen, 1988).
Test against a reference standard (2×2)
- Choose the column holding the reference standard (for example the diagnosis) and, for each column, the value that counts as positive.
- Sensitivity: the share of positives the test detects. Specificity: the share of negatives it recognizes as negative. Positive and negative predictive value: the share of those testing positive or negative for whom that is correct. Likelihood ratios LR+ and LR− show how strongly a result shifts the probability (LR+ from 10 strong, LR− below 0.1 strong).
- The predictive values only hold for the prevalence of the positive reference in the sample; sensitivity and specificity do not. If the test is a number (points instead of "flagged/not flagged"), the result of "Do groups differ?" offers a ready-made ROC command for PSPP.
For two by two cells risk measures can be added: risk per group, risk difference, relative risk and the NNT (the number of people needed for one additional benefit or harm). The person chooses the roles, "Is the event desirable?" and the study design (case-control study: only the odds ratio); Statable never guesses silently. More in the article "Risk measures".
χ²(1, N = 150) = 86.08, p < .001, V = .76; sensitivity = .90, 95% CI [.79, .96]; specificity = .88, 95% CI [.80, .93]; LR+ = 7.50, 95% CI [4.38, 12.85]
For specialists
Proportions with the Wilson interval (as epiR::epi.tests, method = "wilson"), likelihood ratios with the log interval after Simel et al. (1991), odds ratio with the Wald interval. The classification of the likelihood ratios follows Jaeschke et al. (1994).
Typical examples
- Phone in bed by gender: chi-square.
- Recommendation for secondary school by parents' education.
- Screening positive or negative against the diagnosis: sensitivity and specificity.