T-Tests Hypothesis Testing Inferential Statistics 25 min read July 22, 2026
BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

One-Sample vs Two-Sample T-Test: What's the Difference?

A quality engineer checks whether a factory's output meets the 500 ml specification on the label. She has one group of bottles and one target number. That's a one-sample t-test. A clinical researcher wants to know whether a new drug lowers blood pressure more than a placebo. She has two separate groups of patients. That's a two-sample t-test. Picking the wrong one produces a meaningless result — even if the math runs fine.

This guide explains both tests from the ground up: what they measure, when to use each, how their formulas differ, and what their assumptions require. You get fully worked examples, a plain-English decision tree, software code for R and Python, and an interactive calculator below.

What You'll Learn
  • ✓ The exact definition of each test and the one question that separates them
  • ✓ Formulas for one-sample t, two-sample t (Student's), and Welch's t-test
  • ✓ Assumptions for each test and how to verify them
  • ✓ Two fully worked examples — exam scores and drug trial
  • ✓ A decision tree for choosing one-sample, two-sample, or paired t-test
  • ✓ How to run both tests in R, Python (SciPy), Excel, and SPSS
  • ✓ Common mistakes and how to avoid them

The Short Answer: One Question Separates Them

💡
Featured Snippet — One-Sample vs Two-Sample T-Test

A one-sample t-test compares one group's mean to a fixed number (a known or hypothesized population value). A two-sample t-test compares the means of two independent groups to each other. The single deciding question: are you comparing your data to a benchmark value, or to another group of data?

Both tests belong to the same family of statistical procedures developed by William Sealy Gosset — who published as "Student" in 1908 — to test whether a sample mean differs from what you'd expect by chance alone. The difference between them is not mathematical complexity; it's what you're comparing. A one-sample test asks "does my group match this standard?" A two-sample test asks "do these two groups match each other?"

1
Group in a one-sample t-test
2
Groups in a two-sample t-test
μ₀
Fixed reference value needed for one-sample
n−1
Degrees of freedom (one-sample)
n₁+n₂−2
Degrees of freedom (two-sample, equal variances)

What Is a One-Sample T-Test?

Definition — One-Sample T-Test
A one-sample t-test is a parametric hypothesis test that determines whether the mean of a single sample (x̄) differs significantly from a pre-specified population value (μ₀). The population standard deviation is unknown and estimated from the sample.
H₀: μ = μ₀  |  t = (x̄ − μ₀) / (s / √n)

The test was created to handle a practical problem: you have data from one group, and you want to know whether that group's true average equals some target, standard, or historical benchmark. The benchmark (μ₀) must come from outside your data — it could be a regulatory standard, a prior study result, a manufacturer's claimed specification, or a national average. You do not estimate it from the same sample.

Because you are estimating the population standard deviation (σ) from the sample standard deviation (s), the test statistic follows a t-distribution rather than the standard normal distribution. The shape of that distribution depends on degrees of freedom: df = n − 1. With larger samples, the t-distribution approaches the normal distribution, which is why the t-test and z-test give nearly identical results when n is large. See the full guide to the one-sample t-test for a deeper treatment.

When to Use the One-Sample T-Test

Use the one-sample t-test when all three conditions hold: you have a single group, the outcome is measured on a continuous scale, and you have a specific target value to compare against. Real-world situations that fit this pattern include:

  • A teacher wants to know whether her class's average score (x̄ = 73) matches the district benchmark of 70.
  • A manufacturer checks whether the mean fill volume of bottles (x̄ = 497 ml) matches the specification of 500 ml.
  • A nutritionist tests whether the mean daily calorie intake of study participants equals the national recommendation of 2,000 kcal.
  • A hospital checks whether its mean patient wait time matches the national average of 24 minutes.

One-Sample T-Test Formula

One-Sample T-Test Statistic
t = (x̄ − μ₀) / (s / √n)
= sample mean μ₀ = hypothesized population mean s = sample standard deviation n = sample size df = n − 1 SE = s / √n

The numerator (x̄ − μ₀) measures the raw difference between your sample mean and the target. The denominator (s / √n) is the standard error — how much the sample mean would vary from sample to sample due to chance alone. Dividing by the standard error converts the raw difference into a t-score: how many standard errors away from μ₀ your sample mean sits.

Assumptions of the One-Sample T-Test

AssumptionWhat It MeansHow to Check
Random samplingThe sample must be drawn randomly from the populationReview study design
Continuous dataThe outcome is measured on an interval or ratio scaleCheck variable type
Approximate normalityThe population is normally distributed, or n ≥ 30 (CLT applies)Histogram, Shapiro-Wilk test, or Q-Q plot
No extreme outliersOutliers can distort the mean and inflate sBoxplot, IQR rule, Grubbs' test
σ unknownThe population SD is estimated from sample data — otherwise use a z-testCheck whether σ is truly known
Assumption framework follows Laerd Statistics (2023). One-Sample T-Test in SPSS Statistics. See also: Normality Tests Guide on Statistics Fundamentals.

What Is a Two-Sample T-Test?

Definition — Two-Sample T-Test (Independent Samples T-Test)
A two-sample t-test (also called an independent samples t-test) tests whether the population means of two separate, unrelated groups are equal. It compares the difference between the two sample means (x̄₁ − x̄₂) against zero, accounting for variability in both groups.
H₀: μ₁ = μ₂  |  t = (x̄₁ − x̄₂) / SE_pooled

The two-sample t-test answers a different question than the one-sample version: not "does my group match a benchmark?" but "do these two groups differ from each other?" The key word is independent — the participants in Group 1 must have no relationship to the participants in Group 2. If the same people appear in both conditions (before/after, left eye/right eye), the correct test is the paired samples t-test, not the two-sample t-test.

There are two common versions of the two-sample t-test. Student's version assumes the two populations have equal variances and uses a pooled standard error. Welch's version drops that assumption and is recommended as the default in most modern statistical software — including R's default behavior — because it is robust when variances are unequal without losing much power when they are equal.

When to Use the Two-Sample T-Test

The two-sample t-test fits when you have two independent groups and want to know whether their means differ. Common applications include:

  • Comparing exam scores between students taught with Method A and students taught with Method B (two separate classrooms).
  • Testing whether a drug group and a placebo group have different average blood pressure readings.
  • A/B testing: comparing average session time for users who saw Design A versus Design B.
  • Comparing average salaries between male and female employees in the same role.
  • Checking whether defect rates differ between two production lines.

Two-Sample T-Test Formulas

Student's Two-Sample T-Test (Equal Variances Assumed)
t = (x̄₁ − x̄₂) / (s_p × √(1/n₁ + 1/n₂))
s_p² = pooled variance = [(n₁−1)s₁² + (n₂−1)s₂²] / (n₁+n₂−2) df = n₁ + n₂ − 2
Welch's T-Test (Unequal Variances — Recommended Default)
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
df = Welch-Satterthwaite approximation SE = √(s₁²/n₁ + s₂²/n₂)

The Welch-Satterthwaite formula for degrees of freedom is:

Formula
df = (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)]

This gives a non-integer df in most cases, which is handled automatically by statistical software. See the detailed breakdown of equal vs unequal variance t-tests for guidance on when each version applies.

Assumptions of the Two-Sample T-Test

AssumptionWhat It MeansHow to Check
Independence between groupsThe two groups contain different, unrelated subjectsReview study design
Independence within groupsObservations within each group are independent of each otherReview data collection process
Continuous dataThe outcome is measured on an interval or ratio scaleCheck variable type
Approximate normalityEach group's population is approximately normal, or n₁ and n₂ ≥ 30Histograms, Shapiro-Wilk on each group
Equal variances (Student's only)σ₁² ≈ σ₂² — otherwise use Welch's t-testLevene's test or F-test for equality of variances
No extreme outliersSevere outliers distort both means and standard deviationsBoxplots for each group
⚠️
Equal Variance Warning

Most textbooks teach Student's t-test (equal variances assumed). In practice, Welch's t-test is safer and is now the default in R (t.test()), SPSS ("Separate Variance Estimates"), and many Python libraries. If you're unsure whether variances are equal, use Welch's — it performs well even when variances are equal, but Student's performs poorly when they are unequal.

Key Differences: One-Sample vs Two-Sample T-Test

Feature One-Sample T-Test Two-Sample T-Test
Number of groups1 group2 independent groups
What it comparesSample mean vs. a fixed value (μ₀)Two sample means vs. each other
Null hypothesisH₀: μ = μ₀H₀: μ₁ = μ₂
Reference valueKnown or hypothesized value (must exist independently)Not needed — groups compared directly
Test statistict = (x̄ − μ₀) / (s / √n)t = (x̄₁ − x̄₂) / SE_pooled
Degrees of freedomdf = n − 1df = n₁ + n₂ − 2 (Student's) or Welch's approximation
Standard error formulaSE = s / √nSE = s_p × √(1/n₁ + 1/n₂) or √(s₁²/n₁ + s₂²/n₂)
Extra assumptionNone beyond basic t-test requirementsIndependence between groups; equal variances (Student's only)
Common use caseQuality control, benchmark testing, clinical targetsA/B testing, treatment vs control, group comparisons
Software defaultsR: t.test(x, mu=μ₀)R: t.test(x, y) (Welch's by default)

Extended Comparison: How Related Tests Compare

Feature Two-Sample T-Test Paired T-Test
Subject structureDifferent people in each groupSame people measured twice (or matched pairs)
How it worksCompares two group means directlyComputes difference per pair, then one-sample t on differences
Null hypothesisH₀: μ₁ = μ₂H₀: μ_d = 0
Degrees of freedomn₁ + n₂ − 2n_pairs − 1
Statistical powerLower — between-subject variability is noiseHigher — removes between-subject variability
Typical useRCTs with separate treatment/control groupsPre/post studies, crossover trials, matched pairs
Feature Two-Sample T-Test Welch's T-Test
Variance assumptionEqual population variances (σ₁² = σ₂²)No assumption about variances
Degrees of freedomn₁ + n₂ − 2 (integer)Welch-Satterthwaite formula (non-integer)
Pooled SDYesNo
When to useWhen Levene's test confirms equal variancesDefault recommendation; robust to variance differences
Feature One-Sample T-Test One-Sample Z-Test
Population SDUnknown — estimated from sample (s)Known — σ is given
Distribution usedt-distribution (heavier tails)Standard normal distribution
When to useTypical research — σ is almost never knownOnly when σ is truly known from theory or large prior studies
Critical value at α = 0.05 (two-tailed)Depends on df (e.g., t* = 2.048 for df = 29)Always z* = 1.96

Decision Guide: Which T-Test Should You Use?

T-Test Decision Tree

❓ How many groups do you have?
→ One group + a fixed target value
✅ One-Sample T-Test
e.g., Does our mean = 500 ml?
→ Two groups — different people in each
Are variances equal? (Levene's test)
→ Yes (p > 0.05 for Levene's)
✅ Student's Two-Sample T-Test
→ No (p ≤ 0.05) or unsure
✅ Welch's T-Test (recommended default)
→ Two conditions — same people in both
✅ Paired T-Test (see guide)
→ Three or more groups
✅ One-Way ANOVA (not a t-test)
Practical Rule

When in doubt between Student's two-sample t-test and Welch's t-test, choose Welch's. Modern statistical software defaults to Welch's because it is more robust to violations of the equal-variance assumption without a meaningful penalty when variances happen to be equal. The equal vs unequal variance guide covers the formal test for deciding.

The CHOOSE Framework for T-Test Selection

Original Framework — Statistics Fundamentals

CHOOSE: A 6-Step Decision Framework for T-Test Selection

C
Check the Research Question What are you actually trying to find out? Write it in plain English before touching any data.
H
Hypothesize Correctly Write your null and alternative hypotheses. H₀: μ = μ₀ for one-sample; H₀: μ₁ = μ₂ for two-sample.
O
Observe the Number of Groups One group → one-sample. Two separate groups → two-sample. Same people in both conditions → paired.
O
Outline Assumptions Verify normality, independence, and equal variances (for Student's). Adjust to Welch's if needed.
S
Select the Correct T-Test Use the decision tree above. Run the test. Report the t-statistic, degrees of freedom, p-value, and effect size.
E
Explain the Results State your decision in plain English tied to the research question. Report Cohen's d alongside the p-value.

Worked Examples: Step-by-Step Calculations

Example 1 — One-Sample T-Test: Student Exam Scores

Worked Example 1 — One-Sample T-Test

Problem: A statistics instructor believes the national average score on a standardized exam is 70. She randomly selects 25 students from her class and records their scores. The sample produces x̄ = 75.4 with s = 12.8. At α = 0.05, is there evidence that her students' mean score differs from 70?

One-Sample T-Test Formula
t = (x̄ − μ₀) / (s / √n)
1

State hypotheses: H₀: μ = 70  |  H₁: μ ≠ 70 (two-tailed — testing for any difference)

2

Significance level and critical value: α = 0.05, two-tailed. df = n − 1 = 25 − 1 = 24. From the t-distribution table, t* = ±2.064.

3

Check assumptions: Random sample ✓. Scores are continuous ✓. n = 25; normality assumed for exam scores ✓. No information on extreme outliers — check boxplot in practice.

4

Calculate the test statistic:
SE = s / √n = 12.8 / √25 = 12.8 / 5 = 2.56
t = (75.4 − 70) / 2.56 = 5.4 / 2.56 = 2.109

5

Find p-value: |t| = 2.109 with df = 24. Using t-distribution software or table: p ≈ 0.046

6

Decision: p = 0.046 < α = 0.05. Also, |t| = 2.109 > t* = 2.064. Reject H₀.

✅ Conclusion: At the 5% significance level, there is sufficient evidence that the mean score of the instructor's students (x̄ = 75.4) differs from the national benchmark of 70. The class performed above the benchmark. Cohen's d = (75.4 − 70) / 12.8 = 0.42 — a moderate effect size.

Formula and degrees of freedom convention follow Gosset (Student), W.S. (1908). "The probable error of a mean." Biometrika, 6(1), 1–25. Effect size interpretation based on Cohen (1988) thresholds (small: d ≥ 0.2, medium: d ≥ 0.5, large: d ≥ 0.8) via Cohen's d Guide.

Example 2 — Two-Sample T-Test: Drug vs Placebo Blood Pressure

Worked Example 2 — Two-Sample T-Test (Welch's)

Problem: A clinical trial tests a new antihypertensive drug. 30 patients receive the drug (Group 1) and 30 receive a placebo (Group 2). After 8 weeks, mean systolic blood pressure reductions are: Drug: x̄₁ = 14.2 mmHg, s₁ = 6.1; Placebo: x̄₂ = 8.7 mmHg, s₂ = 9.4. At α = 0.05, does the drug reduce blood pressure more than placebo?

Welch's Two-Sample T-Test Formula
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
1

State hypotheses: H₀: μ₁ = μ₂ (drug and placebo produce the same reduction)  |  H₁: μ₁ > μ₂ (drug reduces BP more — one-tailed)

2

Check variance equality: s₁ = 6.1, s₂ = 9.4 — ratio s₂/s₁ ≈ 1.54. Variances differ enough to recommend Welch's t-test. α = 0.05, one-tailed.

3

Check assumptions: Two independent groups ✓. Continuous outcome ✓. n₁ = n₂ = 30 → CLT applies ✓. Subjects in drug group are different from subjects in placebo group ✓.

4

Calculate test statistic:
SE = √(6.1²/30 + 9.4²/30) = √(37.21/30 + 88.36/30) = √(1.2403 + 2.9453) = √4.1856 = 2.046
t = (14.2 − 8.7) / 2.046 = 5.5 / 2.046 = 2.688

5

Degrees of freedom (Welch-Satterthwaite): df ≈ 48.7 (use software for exact value). One-tailed p-value for t = 2.688 with df ≈ 48: p ≈ 0.005

6

Decision: p = 0.005 < α = 0.05. Reject H₀. The drug group showed significantly greater BP reduction.

✅ Conclusion: At the 5% significance level, there is sufficient evidence that the drug reduces systolic blood pressure more than the placebo (mean difference = 5.5 mmHg). Cohen's d = 5.5 / s_pooled — the effect is clinically relevant. Note: this is why Welch's test was used; Student's test would have been incorrect given the unequal standard deviations (6.1 vs 9.4).

How to Run These Tests in Software

R

R — One-Sample T-Test
# One-sample t-test: compare sample mean to μ₀ = 70
scores <- c(78, 82, 65, 71, 80, 75, 88, 69, 74, 77)
t.test(scores, mu = 70, alternative = "two.sided", conf.level = 0.95)

# Output: t statistic, df, p-value, confidence interval, sample mean
R — Two-Sample T-Test (Welch's, default)
# Welch's two-sample t-test (var.equal = FALSE is the default)
drug    <- c(15, 12, 18, 14, 13, 16)
placebo <- c(8, 10, 9, 7, 11, 6)
t.test(drug, placebo, alternative = "greater", var.equal = FALSE)

# For Student's (equal variances), set var.equal = TRUE

Python (SciPy)

Python — One-Sample T-Test (SciPy)
from scipy import stats
import numpy as np

scores = np.array([78, 82, 65, 71, 80, 75, 88, 69, 74, 77])

# One-sample t-test against μ₀ = 70
t_stat, p_value = stats.ttest_1samp(scores, popmean=70)
print(f"t = {t_stat:.4f}, p = {p_value:.4f}")
Python — Two-Sample T-Test (Welch's via SciPy)
from scipy import stats

drug    = [15, 12, 18, 14, 13, 16]
placebo = [8, 10, 9, 7, 11, 6]

# Welch's t-test (equal_var=False is the default)
t_stat, p_value = stats.ttest_ind(drug, placebo,
                                    equal_var=False,
                                    alternative='greater')
print(f"t = {t_stat:.4f}, p = {p_value:.4f}")

# Student's (equal variances): equal_var=True

Excel

Excel has built-in functions for both tests. Navigate to Data → Data Analysis → t-Test or use these formulas directly:

Excel Functions
=== One-Sample T-Test ===
# Calculate t-statistic manually:
= (AVERAGE(A2:A26) - 70) / (STDEV(A2:A26) / SQRT(COUNT(A2:A26)))

# Two-tailed p-value:
= T.TEST(A2:A26, reference_array_equal_to_mu0, 2, 1)

=== Two-Sample T-Test ===
# Data Analysis → t-Test: Two-Sample Assuming Unequal Variances (Welch's)
= T.TEST(A2:A31, B2:B31, 1, 3)
# Tails: 1=one-tailed, 2=two-tailed
# Type: 1=paired, 2=equal variance, 3=unequal variance (Welch's)

For a guided walk-through, see the interactive t-test calculator on Statistics Fundamentals, which handles both test types with step-by-step output.

Interactive T-Test Calculator

One-Sample & Two-Sample T-Test Calculator

One-Sample T-Test
Two-Sample T-Test

Common Mistakes and How to Avoid Them

MistakeWrong ApproachCorrect Approach
Using a one-sample test to compare two groups Running t.test(group1, mu=mean(group2)) — treating one group's mean as a fixed μ₀ Use a two-sample t-test. The mean of group2 carries its own uncertainty and cannot be treated as a known value.
Using a two-sample test on paired data Treating before/after measurements from the same subjects as two independent groups Use the paired t-test. Ignoring the pairing wastes statistical power and violates the independence assumption.
Always using Student's instead of Welch's Assuming equal variances without testing; using Student's two-sample formula when s₁ and s₂ differ substantially Default to Welch's t-test. Run Levene's test if you want to formally check. Student's is fine when variances are confirmed equal.
Confusing statistical significance with practical importance Reporting only p < 0.05 and concluding the difference is large or important Always report effect size (Cohen's d) alongside p-value. A large n can produce a tiny p-value for a meaningless difference.
Choosing one-tailed test after seeing the data Looking at which mean is larger, then choosing the matching directional alternative The tails of the test must be specified before collecting data. Switching after seeing results halves your p-value dishonestly.
Running multiple t-tests instead of ANOVA Comparing 3+ groups with repeated pairwise t-tests (e.g., A vs B, A vs C, B vs C) Use one-way ANOVA for 3+ groups to control the family-wise error rate.

Effect Size: Cohen's d for Both Tests

A statistically significant result tells you the observed difference is unlikely to be due to chance. It says nothing about whether the difference matters in practice. Effect size addresses that gap. For t-tests, Cohen's d is the standard measure.

Cohen's d — Effect Size for T-Tests
One-sample: d = (x̄ − μ₀) / s
Two-sample: d = (x̄₁ − x̄₂) / s_pooled
d < 0.2 = negligible d ≈ 0.2 = small d ≈ 0.5 = medium d ≥ 0.8 = large

Cohen's d thresholds were proposed by Jacob Cohen in Statistical Power Analysis for the Behavioral Sciences (1988). They are widely cited and used across disciplines, including the APA's guidelines on reporting statistical results. For full worked calculations and interpretation, see the Cohen's d guide and the effect size calculator on Statistics Fundamentals.

How to Report Results (APA Format)

Both tests share the same reporting template. Report the test type, t-statistic, degrees of freedom, p-value, confidence interval, and effect size. The APA Style Guide for statistics sets the standard most journals and academic programs follow.

APA Reporting Templates

One-Sample T-Test

A one-sample t-test indicated that the mean exam score (M = 75.40, SD = 12.80) was significantly higher than the benchmark of 70, t(24) = 2.11, p = .046, d = 0.42, 95% CI [0.11, 10.70].

Two-Sample T-Test (Welch's)

A Welch's independent-samples t-test revealed a significant difference in blood pressure reduction between the drug group (M = 14.20, SD = 6.10) and the placebo group (M = 8.70, SD = 9.40), t(48.7) = 2.69, p = .005, d = 0.70, 95% CI [1.38, 9.62].

Real-World Applications by Field

🏥

Healthcare

One-sample: checking whether a hospital's average treatment time meets the 4-hour target. Two-sample: comparing infection rates between a treatment group and a control group in a clinical trial.

🎓

Education

One-sample: testing whether a school's average SAT score matches the national average. Two-sample: comparing test scores between students taught with online vs in-person instruction.

🏭

Manufacturing

One-sample: verifying that the mean fill volume of a production run matches the labeled 500 ml. Two-sample: comparing defect rates between two production lines or two suppliers.

📊

Data Science / A/B Testing

Two-sample: the standard test for A/B experiments — comparing mean conversion time, session length, or revenue between a control group and a variant group.

💼

Business Analytics

One-sample: testing whether average customer satisfaction scores meet the company's 4.0 target. Two-sample: comparing average sales between two sales teams or two regions.

🌱

Agriculture / Biology

One-sample: comparing crop yield against the variety's published average. Two-sample: testing whether a new fertilizer produces higher yield than the control condition.

Entity and Formula Glossary

TermSymbolDefinition
One-Sample T-TestTests whether a single sample mean equals a known or hypothesized population value (μ₀)
Two-Sample T-TestTests whether the means of two independent samples are equal; also called independent samples t-test
Welch's T-TestA variant of the two-sample t-test that does not assume equal population variances; recommended default
Paired T-TestTests whether the mean of pairwise differences equals zero; used when subjects appear in both conditions
Null HypothesisH₀The default claim being tested: μ = μ₀ (one-sample) or μ₁ = μ₂ (two-sample)
Alternative HypothesisH₁The research claim: can be two-tailed (≠), right-tailed (>), or left-tailed (<)
t-StatistictThe test statistic: standardized distance of the sample mean from the null hypothesis value, measured in standard errors
p-valuepProbability of observing a t-statistic as extreme as the one computed, assuming H₀ is true; reject H₀ when p < α
Degrees of FreedomdfA parameter of the t-distribution; df = n−1 for one-sample; df = n₁+n₂−2 for Student's; Welch's approximation for Welch's
Standard ErrorSEThe estimated standard deviation of the sampling distribution of the mean; SE = s/√n for one-sample
Pooled Standard Deviations_pWeighted average of the two group standard deviations; used only in Student's two-sample t-test
Effect Size (Cohen's d)dStandardized measure of the practical size of the difference; d = (x̄−μ₀)/s (one-sample) or (x̄₁−x̄₂)/s_p (two-sample)
Significance LevelαPre-set threshold for rejecting H₀; conventionally 0.05, meaning a 5% false-positive rate
Confidence IntervalCIRange of plausible values for the population mean difference; a 95% CI does not contain μ₀ when p < 0.05 (two-tailed)
Statistical Power1−βProbability of correctly rejecting a false H₀; increases with larger n and larger effect sizes
Population MeanμThe true (unknown) average of the entire population being studied
Sample MeanThe average of the observed sample data; an unbiased estimator of μ
Equal Variance Assumptionσ₁²=σ₂²The assumption that both populations have the same variance; required for Student's two-sample t-test; not required for Welch's
William Sealy Gosset"Student"The statistician who derived the t-distribution in 1908 while working at Guinness Brewery; published under the pseudonym "Student"

Frequently Asked Questions

A one-sample t-test compares the mean of a single sample to a known or hypothesized population value. A two-sample t-test compares the means of two independent groups. The key difference is that a one-sample test uses one dataset and a reference value, while a two-sample test compares two separate datasets.
Yes. The terms two-sample t-test, independent samples t-test, and independent groups t-test all describe the same statistical test. Although textbooks and software may use different names, the calculations and interpretation are identical.
No. A one-sample t-test assumes the comparison value is fixed and known without uncertainty. When comparing two groups, both sample means have sampling variability, so you should use a two-sample t-test, which accounts for uncertainty in both groups.
Welch's t-test is generally recommended as the default for comparing two independent groups because it does not require equal population variances. Student's t-test assumes equal variances, which is often unrealistic in practice. Welch's test performs well whether variances are equal or unequal, making it the preferred choice for most analyses.
The null hypothesis states that the two population means are equal, or equivalently, that their difference is zero (H₀: μ₁ − μ₂ = 0). The alternative hypothesis may be two-sided (μ₁ ≠ μ₂) or one-sided (μ₁ > μ₂ or μ₁ < μ₂), depending on the research question.
A two-sample t-test compares two independent groups, while a paired t-test compares two measurements taken from the same individuals or matched pairs. For example, comparing blood pressure before and after treatment uses a paired t-test, whereas comparing patients receiving a treatment with a separate control group uses a two-sample t-test.
The required sample size depends on the expected effect size, desired statistical power, and significance level. For a medium effect size (Cohen's d = 0.5), α = 0.05, and 80% power, a one-sample t-test typically requires about 34 observations, while a two-sample t-test requires about 64 observations in total (32 per group). A formal power analysis should always be performed before collecting data.
When the normality assumption is not satisfied, nonparametric alternatives are recommended. The Wilcoxon Signed-Rank Test replaces the one-sample and paired t-tests, while the Mann-Whitney U Test replaces the independent two-sample t-test. These methods analyze ranked data and do not require normally distributed observations.
For a one-sample t-test, the confidence interval estimates the range of plausible values for the population mean. For a two-sample t-test, it estimates the range of plausible values for the difference between the two population means. If the confidence interval for the mean difference does not include zero, the difference is statistically significant at the corresponding significance level.