Nonparametric Methods and Categorical Data
This domain covers analyses that do not rely on a normal distribution: rank-based tests for location and association, and chi-square procedures for counts in categories.
Rank-based tests
- Use them when data are ordinal, samples are small with clearly non-normal shape, or outliers dominate the mean.
- The sign test counts positive differences and ignores magnitude; it is weak but needs almost no assumptions.
- Wilcoxon signed-rank ranks the absolute differences for paired data; Mann-Whitney U compares two independent groups; Kruskal-Wallis extends this to k groups; Friedman handles ranked data in blocks.
- These tests generally compare medians or whole distributions, so phrase conclusions accordingly.
Chi-square procedures
- Goodness of fit: chi-square equals the sum over categories of (observed minus expected) squared divided by expected, with degrees of freedom equal to categories minus 1, minus one for each parameter estimated from the data.
- Test of independence in an r by c table: expected cell count equals row total times column total divided by n, and degrees of freedom equal (r minus 1)(c minus 1).
- Expectation: at least 80% of expected counts should be 5 or more and none below 1; for 2 by 2 tables with small counts use Fisher's exact test.
- McNemar's test compares paired proportions measured on the same subjects.
Worked example
Group A has 30 yes and 20 no; group B has 15 yes and 35 no. Column totals are 45 yes and 55 no, with n = 100 and each group of 50. Expected A-yes is 50 times 45 divided by 100 = 22.5, and the other expected counts are 27.5, 22.5 and 27.5. Then chi-square = 56.25/22.5 + 56.25/27.5 + 56.25/22.5 + 56.25/27.5 = 2.50 + 2.05 + 2.50 + 2.05 = 9.09. With 1 degree of freedom the critical value is 3.84, so independence is rejected.
Traps
- Computing equal expected counts for an independence test instead of row times column over n.
- Using n minus 1 degrees of freedom for a contingency table.
- Running chi-square when several expected counts are below 5.
- Ignoring the continuity correction option in 2 by 2 tables, then wondering why software and hand calculations disagree.