How to run a one-sample t-test
A one-sample t-test compares the mean of a single sample to a hypothesized population mean. It applies when the population standard deviation is unknown and the sample is drawn from a normally distributed population or the sample size is sufficiently large ().
The setup
Define the null hypothesis () and the alternative hypothesis (, , or ). Choose a significance level, typically . Identify the sample size (), sample mean (), and sample standard deviation ().
The steps
- Compute the test statistic: . 2. Determine the degrees of freedom: . 3. Find the p-value or critical t-value using a t-distribution table. 4. Compare the test statistic to the critical value. 5. Reject if the p-value or if the test statistic falls in the rejection region.
Checking the result
Verify that the sample data does not contain severe outliers using a boxplot. Ensure the sample size justifies the assumption of normality via the Central Limit Theorem if the underlying distribution is not perfectly normal.
Common errors
Using a z-test instead of a t-test when the population standard deviation is unknown is a standard mistake. Another error is incorrectly substituting the sample variance () for the sample standard deviation () in the denominator.
Worked example
A machine is supposed to fill bottles with 500 mL of water. A sample of 16 bottles has a mean volume of 495 mL and a standard deviation of 8 mL. Test if the machine is underfilling at .
. . , , , . Compute standard error: . Compute t-statistic: . Degrees of freedom: . The critical value for a one-tailed test at with is . Since , we reject . The machine is underfilling.
FAQ
Run your own problem
References: OpenStax Introductory Statistics, Chapter 9 · Khan Academy Unit: Significance tests (hypothesis testing)
See also