PickMyTest

Independent Samples t-Test

Compare means of two independent groups

Independent Samples t-Test#

The independent samples t-test (also: two-sample t-test) tests whether the means of two independent groups differ significantly.

When to Use#

Use the t-test when you want to:

  • Compare two independent groups
  • The dependent variable is metric (continuous)
  • The data in both groups are approximately normally distributed

Assumptions#

  • Independence of observations
  • Metric scale of the dependent variable
  • Normal distribution in both groups (Shapiro-Wilk test)
  • Homogeneity of variance (Levene's test) – if violated: Welch's t-test

Formula#

The test statistic is calculated as:

t=XΛ‰1βˆ’XΛ‰2sp1n1+1n2t = \frac{\bar{X}_1 - \bar{X}_2}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}

where sps_p is the pooled standard deviation:

sp=(n1βˆ’1)s12+(n2βˆ’1)s22n1+n2βˆ’2s_p = \sqrt{\frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1 + n_2 - 2}}

Example#

Practical Example: Drug Effectiveness

A researcher wants to know if a new drug lowers blood pressure. They randomly assign 40 patients to two groups:

  • Group 1 (n=20): Receives the drug
  • Group 2 (n=20): Receives a placebo

After 4 weeks, blood pressure is measured. The t-test compares the mean blood pressure values of both groups.

Effect Size#

Cohen's d as a measure of effect size:

d=XΛ‰1βˆ’XΛ‰2spd = \frac{\bar{X}_1 - \bar{X}_2}{s_p}
Effect SizeCohen's d
Small0.2
Medium0.5
Large0.8

Further Reading

  • Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25.
  • Field, A. (2018). Discovering Statistics Using IBM SPSS Statistics (5th ed.). SAGE.
  • Bortz, J. & Schuster, C. (2010). Statistik fΓΌr Human- und Sozialwissenschaftler (7th ed.). Springer.