Hypothesis Tests About a Mean (σ Unknown): the t Test (p-value approach)
When the population standard deviation σ is not known, we replace it with the sample standard deviation s.
Under common conditions, the resulting test statistic follows a t distribution with df = n − 1.
When is the t procedure appropriate?
The t test is used for testing a population mean when σ is unknown. It works best when the sample comes from a population
that is approximately normal, and it is typically robust for larger samples. For very small samples from clearly non-normal
populations, a nonparametric alternative may be more appropriate.
Test statistic (one-sample t)
Let x̄ be the sample mean, s be the sample standard deviation, and n be the sample size. The standard error is:
\[
s_{\bar{x}}=\frac{s}{\sqrt{n}}
\]
The t test statistic is:
\[
t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}
\quad\text{with}\quad
df=n-1
\]
The p-value approach
The p-value measures how extreme the observed test statistic is if the null hypothesis were true. The tail type is determined
by the alternative hypothesis:
- State hypotheses. H0 includes equality (μ = μ0), and H1 sets the direction (≠, <, or >).
- Compute the test statistic. Find t using x̄, s, and n; set df = n − 1.
- Find the p-value. Use the t distribution with df degrees of freedom to get the tail area(s) beyond the observed t.
- Decide. If p-value ≤ α, reject H0. If p-value > α, do not reject H0.
How this calculator supports the method
- Summary mode: enter n, x̄, and s.
- Raw/CSV mode: paste values or upload a CSV; the tool computes n, x̄, and s automatically.
- Outputs: t, df, p-value, and the decision using the p-value rule.
- Visualization: a t-curve with optional shading for the p-value region and/or α rejection region, plus a slider and animation.
Mini example (concept)
Suppose you test whether a product’s mean lifetime is less than 65 months. You sample n values, compute x̄ and s, then use the
left-tailed t test. If the p-value is below your chosen α, you reject H0 and conclude the mean lifetime is lower than 65.