Overview

When users want to relate a binary variable to a continuous or discrete variable, Statwing runs a two-tailed t-test to assess whether either of the two groups tends to have higher values than the other for the continuous/discrete variable. Statwing defaults to the Welch’s t-test, also known as the t-test for unequal variances; if the assumptions of that test are not met, Statwing recommends a ranked version of the same test.

Assumptions of Welch’s T-Test

Statwing recommends Welch’s t-test (hereafter “t-test”) if several assumptions about the data hold:

• The sample size of each group is above 15 (and therefore the Central Limit Theorem satisfies the requirement for normally distributed data).
• There are few or no outliers in the continuous/discrete data.
• The data are in fact continuous or discrete and not ordinal.

Unlike the slightly more common t-test for equal variances, Welch’s t-test does not assume that the variances of the two groups being compared are equal. Modern computing has made that assumption unnecessary. Furthermore, assuming equal variances leads to less accurate results when variances are not in fact equal, and its results are no more accurate when variances are actually equal (Ruxton, 2006).

Ranked T-Test

When assumptions are violated, the t-test may no longer be valid. In that case, Statwing recommends the ranked t-test; Statwing rank-transforms the data (replaces values with their rank ordering) and then runs the same Welch’s t-test on that transformed data. The ranked t-test is robust to outliers and non-normally distributed data. Rank transformation is a well-established method for protecting again assumption violation (a “nonparametric” method), and is most commonly seen in the difference between Pearson and Spearman correlation (Conover and Iman, 1981). Rank transformation followed by Welch’s t-test is similar in effect to the Mann-Whitney U Test, but somewhat more efficient (Ruxton, 2006Zimmerman, 2012).

Note that while the t-test tests for the equality of the means of the two groups, the ranked t-test does not explicitly test for differences between the groups means or medians. Rather, it test for a general tendency of one group to have larger values than the other.