Two-sample paired tests (t, sign, Wilcoxon)

Three statistical tests (one parametric, two non-parametric) for two samples (columns) of univariate data. The data points are paired, meaning that the two values in each row are associated. For example, the test could be the for length of the left vs. the right arm in a number of people, or the diversity in summer vs. winter at a number of sites. Controlling for a “nuisance factor” (person, site) in this way increases the power of the test. The null hypothesis is:

H0: The mean (t test) or median (sign test, Wilcoxon test) of the difference is zero.

All reported p values are two-tailed. For mathematical details, see the Past manual.

t test

Testing for mean difference equal to zero using the standard one-sample t test on the differences. There are n-1 degrees of freedom. This test assumes normal distribution of the differences.

The exact version of the test calculates all possible group reassignments within pairs. It is only computed for less than 23 pairs.

Sign test

The sign (binomial) test simply counts the number of cases n1 where xi > yi and n2 where yi > xi. The number max(n1n2) is reported. The p value is exact, computed from the binomial distribution. The sign test may have lower power than the other paired tests, but makes few assumptions.

Wilcoxon signed rank test

A non-parametric rank test that does not assume normal distribution. The null hypothesis is no median shift (no difference).

For large n (say n>10), the large-sample approximation to p can be used. This depends on the normal distribution of the test statistic W (see manual for equations).

The Monte Carlo significance value is based on 99,999 random reassignments of values to columns, within each pair. This value will be practically identical to the exact p value.

For n<23, an exact p value is computed, by complete enumeration of all possible reassignments (there are 2n of them, i.e. more than four million for n=22). This is the preferred p value, if available.

Missing data: Supported by deletion of the row.

Published Aug. 31, 2020 9:57 PM - Last modified Aug. 31, 2020 9:57 PM