Independent Samples t-test

Verified

T-Tests

Independently verified. Every statistic this test reports has been re-derived against an independent reference — never the library the pipeline itself calls — the rendered output was read back in a browser, and the result is locked with a committed regression suite.

Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.

Loading teaching datasets…

Or use your own dataset

Loading your datasets…

Tests whether the means of a continuous dependent variable differ between two INDEPENDENT groups, where each subject belongs to exactly one group.

Reports Student's t (pooled-variance) plus Welch's t (heteroscedastic-safe variant) alongside, with df, p, mean difference + 95% CI, and Cohen's d / Hedges' g standardised effect size. Assumption diagnostics include Levene's test for variance homogeneity, Shapiro-Wilk for within-group normality, and outlier screening — the engine auto-prefers Welch when Levene rejects or sample sizes differ. The default two-group comparison for continuous outcomes when pairing isn't available.

Worked example

Do students taught with a new method outscore those taught conventionally?

60 students were randomly assigned to the new method (n = 30) or the conventional one (n = 30); final-exam scores (0–100) were compared. Different students in each group → independent.

Result

The new-method group scored higher (M = 73.9) than the conventional group (M = 68.3), t(58) = 2.96, p = .004, a medium-to-large effect (Cohen's d = 0.77).

How you'd report it (APA)

An independent-samples t-test found the new method (M = 73.9) scored significantly higher than the conventional method (M = 68.3), t(58) = 2.96, p = .004, d = 0.77.

Try it yourself: Load this ready-made sample and follow the run above.

When to use it

  • Differences between two independent groups
    A researcher asks whether salary differs between employees under 21 and those 21 or older.
  • Differences between interventions (post-test only)
    60 adults are randomly assigned to a six-week exercise programme or a no-exercise control.
  • Differences in change (gain) scores
    Two groups of participants are randomly assigned to a dietary intervention or a no-change control.

When NOT to — use instead

  • Same subjects measured twice (paired)
    Independent-t treats observations as unrelated, breaking the pairing structure → use paired t-test for matched / pre-post designs. Paired Samples t-test
  • Unequal variances + unequal group sizes (heteroscedastic)
    Classical Student-t inflates Type-I error in this regime → use Welch's t (heteroscedastic-safe variant) or Welch's ANOVA. Welch's ANOVA (unequal variances)
  • Severely non-normal continuous DV in small samples
    Independent-t needs the CLT to bail out the normality assumption. Mann-Whitney U
  • 3+ independent groups
    Independent-t compares exactly two groups. One-Way ANOVA (3+ groups)

Hypotheses

H₀: μ₁ = μ₂ (the two population means are equal)
Hₐ: μ₁ ≠ μ₂ (the two population means differ)

Parameter tested: μ₁ − μ₂ (difference in population means)

Assumptions (and what to do if they fail)

No influential outliers within each groupmedium

Check: Boxplots by group; identify values >1.5 IQR beyond quartiles; check for extreme z-scores (|z| > 3) within each group

If violated: Outliers may distort group means, inflating or masking the true difference between groups

Approximate normality of the DV within each groupmedium

Check: Q-Q plots for each group (points should fall on diagonal line); histograms per group; visual inspection for severe skewness or heavy tails

If violated: Non-normal data within groups affects t-test validity when sample size is small

Homogeneity of variances (homoscedasticity)high

Check: Levene's test (p > .05 indicates equal variances); Brown-Forsythe test (median-based, more robust); visual inspection: boxplots should show similar IQR across groups

If violated: Unequal variances invalidate the pooled variance estimate used in Student's t-test

Ready to run a Independent Samples t-test on your own data?

Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.

Run this test →