Calculate the difference between two means, or run a two-sample or paired t-test with confidence interval, p-value, and effect size.
Related Calculators
- Weighted Mean Calculator
- Bias Percentage Calculator
- RSD โ Relative Standard Deviation Calculator
- Squared Error Calculator
- All Statistics Calculators
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| Mean 1 โ Mean 2 | Finds the signed difference between two means | Requires Mean 1 and Mean 2 on the same measurement scale |
| Mean 1 | Finds the first mean from the second mean and the difference | Requires Mean 2 and the difference |
| Mean 2 | Finds the second mean from the first mean and the difference | Requires Mean 1 and the difference |
| Check supplied difference | Compares a stated difference with Mean 1 โ Mean 2 | Requires Mean 1, Mean 2 and the difference to check |
| Independent samples t-test | Tests whether two independent groups have the same mean, with a confidence interval and effect sizes | Requires the mean, sample standard deviation and sample size of each group, the t-test method and the confidence level |
| Paired differences t-test | Tests whether the mean of paired differences is zero, with a confidence interval and effect size | Requires the mean difference, the sample standard deviation of the differences, the number of pairs and the confidence level |
The t-test method is Welch for unequal variances or pooled for equal variances, and the confidence level is 90%, 95% or 99%. Both tests are two-sided and need at least two observations per group or two pairs.
Difference Of Means Formulas
| D | Difference of means |
| M1 | Mean of the first group |
| M2 | Mean of the second group |
Mean 1 โ Mean 2
The main formula applies directly. Means of 10 and 7 differ by 10 โ 7 = 3. The sign shows which group is higher.
Mean 1
A second mean of 7 and a difference of 3 put the first mean at 10.
Mean 2
A first mean of 10 and a difference of 3 put the second mean at 7.
Check supplied difference
The calculator works out M1 โ M2 and reports how far the stated difference is from it. For means of 10 and 7 and a stated difference of 2.5, the true difference is 3 and the stated value is off by โ0.5.
Independent samples t-test
โ(s1ยฒ รท n1 + s2ยฒ รท n2) [1]
This is the Welch test. s is each sample standard deviation, n is each sample size, a = s1ยฒ รท n1, b = s2ยฒ รท n2, and ฮฝ is the degrees of freedom [1]. The square root is the standard error SE, and the confidence interval is D ยฑ t* ร SE, with t* taken from the t distribution for ฮฝ.
(n2 โ 1)s2ยฒ) รท (n1 + n2 โ 2) [1]
The pooled method combines the two variances into spยฒ, then uses SE = sp ร โ(1 รท n1 + 1 รท n2) and ฮฝ = n1 + n2 โ 2 [1]. It assumes both groups have the same variance, which should be tested before it is assumed [2].
(1 โ 3 รท (4ฮฝ โ 1)) [4]
Cohen's d is D รท sp, and Hedges' g applies a small-sample correction with ฮฝ = n1 + n2 โ 2 [4]. For means of 59.12 and 54.34, standard deviations of 12.32 and 11.57 and sample sizes of 39 and 41, D = 4.78, sp = 11.94 and g = 0.40 [4]. The Welch test on the same data gives SE = 2.6752, t = 1.787 and ฮฝ = 77.0.
Paired differences t-test
D is the mean of the pairwise differences, sd is their sample standard deviation, n is the number of pairs and ฮฝ = n โ 1 [3]. A mean difference of 2.5 with sd = 4 across 16 pairs gives SE = 1, t = 2.5 and ฮฝ = 15. The effect size dz is D รท sd = 0.625.
What Is the Mean Difference?
The mean difference is one group's average minus another's, in the units of the measurement. A positive value means the first group averages higher. On its own it does not show whether the gap is larger than chance would produce. That takes a t-test, which weighs the difference against the spread and the size of each sample.
Limits of This Estimate
- Both tests assume independent observations, or independent pairs, and sample means that are approximately normal.
- Paired data needs the paired test. Running the independent test on paired measurements ignores the one-to-one link between the samples [1].
- A small p-value shows a difference unlikely to be chance. It does not show that the difference is large enough to matter, or what caused it.
- When every standard deviation is zero, the standard error is zero and the test and interval have no value.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, Section 1.3.5.3, Two-Sample t-Test for Equal Means: test statistic, Welch-Satterthwaite degrees of freedom, pooled variance and paired versus unpaired data
- NIST/SEMATECH e-Handbook of Statistical Methods, Section 7.3.1, Do two processes have the same mean?: testing the equal-variance assumption before pooling
- NIST/SEMATECH e-Handbook of Statistical Methods, Section 7.3.1.1, Analysis of paired observations: paired t statistic and its degrees of freedom
- U.S. Department of Education, What Works Clearinghouse Procedures and Standards Handbook, Version 5.0, Appendix E: Hedges' g, the pooled standard deviation, the small-sample correction and the worked example
