T tests -- When to use

Sameer Mathur

T-test

Probably one of the most popular research questions is whether two independent samples differ from each other. Student's t-test is one of the common statistical test used for comparing the means of two independent or paired samples.

T test assumptions: Normality and equal variances

Statistical errors are common in scientific literature, and about 50% of the published articles have at least one error. Many of the statistical procedures including correlation, regression, t-test, and analysis of variance assume that the data are normally distributed.

A frequent error is to use statistical tests that assume a normal distribution on data that are actually skewed.

We can not always use Student's t-test to compare means. There are different types of t-test: one-sample t-test, the independent two samples t-test and the paired t-test.

Note: These tests are called parametric tests, because their validity depends on the distribution of the data.

Condition for using these tests

These different tests can be used only in certain conditions:

  1. For one-sample t test:
    • Whether the data are normally distributed
  2. For independent two samples t-test:
    • Whether the two groups of samples (\( x \) and \( y \)), being compared, are normally distributed;
    • whether the variances of the two samples are equal or not.
  3. For paired t-test:
    • Whether the difference \( d \) \( (x - y) \) is normally distributed

Test the normality of data

With large enough sample sizes \( (n > 30) \) the violation of the normality assumption should not cause major problems. This implies that we can ignore the distribution of the data and use parametric tests if we are dealing with large sample sizes.

However, to be consistent, normality can be checked by visual inspection normal plots (histogram), Q-Q plot (quantile-quantile plot) or by significance tests.

  • The histogram plot (frequency distribution) provides a visual judgment about whether the distribution is bell shaped.
  • The significance test compares the sample distribution to a normal one in order to ascertain whether data show or not a serious deviation from normality.

There are several methods for normality test such as Kolmogorov-Smirnov (K-S) normality test and Shapiro-Wilk's test.

Note:Shapiro-Wilk's method is widely recommended for normality test and it provides better power than K-S. It is based on the correlation between the data and the corresponding normal scores.

Test the equality of variances

The standard two independent samples t-test assumes also that the samples have equal variances. If the two samples, being compared, follow normal distribution, F-test can be performed to compare the variances.

What to do when the conditions are not met for t-test ?

The following two-stage procedure is wide accepted (view the figure in next slide)

  1. If normality is accepted, the t-test is used;
  2. If the samples being compared are not normally distributed, a non-parametric test like Wilcoxon test is recommended as an alternative to the t-test.