Paired T-Test Calculator

about statistical-calculators.site

Input Data & Settings

PairSample 1Sample 2

How to Use the Paired Samples T-Test Calculator

  1. Enter your paired data into the two columns labeled "Sample 1" and "Sample 2". Each row should represent a related pair (e.g., before and after measurements).
  2. Ensure both samples contain the same number of values. Empty rows will be ignored.
  3. Click the "Calculate" button.
  4. The calculator will display the mean difference, standard deviation of the differences, t-statistic, degrees of freedom, and the p-value.
  5. Use the results to interpret whether the difference between the two sets of data is statistically significant.

What is a Paired Samples T-Test?

A paired samples t-test (also known as a dependent t-test) is a statistical method used to compare two related means. It is commonly applied when measuring the same group before and after an intervention, or comparing matched pairs like twins or pre-test/post-test scores. The test helps determine whether the average difference between the paired observations is statistically significant.

The Formula

The paired t-test works by reducing two related samples into a single set of differences, then running a one-sample t-test on those differences against a hypothesized value (usually 0). The test statistic is:

$$ t = \frac{\bar{d} - \mu_0}{s_d / \sqrt{n}} $$

Where \(\bar{d}\) is the mean of the paired differences, \(\mu_0\) is the hypothesized mean difference (typically 0), \(s_d\) is the standard deviation of the differences, and \(n\) is the number of pairs. The test statistic follows a t-distribution with \(n - 1\) degrees of freedom.

Assumptions of the Paired T-Test

Worked Example

Using this calculator's default data — Sample 1 (before): 10, 15, 8, 11, 13; Sample 2 (after): 12, 14, 9, 11, 15 — the differences (Sample 1 − Sample 2) are: −2, 1, −1, 0, −2. This gives a mean difference d̄ = −0.8, standard deviation of differences sd ≈ 1.30, and with n = 5 pairs (df = 4):

$$ t = \frac{-0.8 - 0}{1.30 / \sqrt{5}} \approx -1.375 $$

With df = 4 and a two-tailed test, this gives p ≈ 0.24. Since p > 0.05, we fail to reject H₀ — there isn't enough evidence, from this small sample, to conclude a significant difference between the before and after measurements.

How to Do This in Statistical Software

Using the default example data in this calculator (Sample 1: 10, 15, 8, 11, 13; Sample 2: 12, 14, 9, 11, 15), here's how to run the same test in common statistical tools.

RStudio

R's built-in t.test() function performs the paired t-test directly with paired = TRUE:

sample1 <- c(10, 15, 8, 11, 13)
sample2 <- c(12, 14, 9, 11, 15)

t.test(sample1, sample2, paired = TRUE, mu = 0, alternative = "two.sided")

Python

scipy.stats.ttest_rel runs the same paired t-test:

from scipy import stats

sample1 = [10, 15, 8, 11, 13]
sample2 = [12, 14, 9, 11, 15]

t_stat, p_value = stats.ttest_rel(sample1, sample2)
print(t_stat, p_value)

SPSS

Analyze → Compare Means → Paired-Samples T Test. Move your two related variables into the Paired Variables box as a pair (Variable 1 and Variable 2), then click OK. SPSS outputs the mean difference, standard deviation, t-statistic, degrees of freedom, and two-tailed significance.

JASP

T-Tests → Paired Samples T-Test. Move your two variables into the Paired Variables box (they should appear side by side as a pair). JASP outputs the t-statistic, df, p-value, and effect size (Cohen's d) by default.

Related Statistical Calculators