Skip to content

One-Sample t-Test

Hypothesis Testing

Tests whether the mean of a single sample differs significantly from a known or hypothesised population value.

When to Use

Use this test when you have one group of observations and want to compare their mean to a specific reference value. For example, testing whether the average reaction time in your sample differs from a published norm of 250 ms, or whether a manufacturing process produces items with a mean weight equal to the target specification.

Assumptions

  • The dependent variable is continuous.
  • Observations are independent.
  • The data are approximately normally distributed, or the sample size is large enough for the Central Limit Theorem to apply.

Required Inputs

InputTypeNotes
ValuesNumericSample values to test against the hypothesised mean
ParameterDefaultOptions
Population Mean0Any numeric value

Output Metrics

MetricWhat it means
NNumber of observations in the sample.
MeanSample mean.
Std DevSample standard deviation.
Std ErrorStandard error of the sample mean.
tTest statistic: (sample mean - hypothesised mean) / standard error.
DFDegrees of freedom (N - 1).
Pr > |t|Two-tailed p-value for the null hypothesis that the population mean equals the hypothesised value.
Hypothesised MeanThe reference value being tested against.
95% CL LowerLower bound of the 95% confidence interval for the population mean.
95% CL UpperUpper bound of the 95% confidence interval for the population mean.

Interpretation

  • If Pr > |t| is less than alpha, the sample mean is significantly different from the hypothesised value.
  • The confidence interval for the population mean provides a range of plausible values. If the hypothesised mean falls outside this interval, the result is significant.
  • The sign and magnitude of the t-statistic indicate the direction and strength of departure from the hypothesised mean.
  • Consider whether the observed difference is practically meaningful, not just statistically significant.

Common Pitfalls

  • The test assumes the hypothesised value is a fixed constant, not estimated from data. Using a value derived from the same sample invalidates the test.
  • With very large samples, even trivially small deviations from the hypothesised mean can be statistically significant. Always examine the effect size.
  • Non-normal data with small samples can produce misleading results. Consider the Wilcoxon signed-rank test as a non-parametric alternative.

How It Works

  1. Compute the sample mean, standard deviation, and standard error.
  2. Calculate the t-statistic as (sample mean - hypothesised mean) / standard error.
  3. Look up the p-value from the t-distribution with N - 1 degrees of freedom.

Citations

References

  • Student (1908). The probable error of a mean. Biometrika, 6(1), 1-25.