Test Statistic Calculator
Calculation Results
Test Statistic (Z or t):
Standard Error:
How to Calculate a Test Statistic
A test statistic is a numerical value used in hypothesis testing to determine whether to reject the null hypothesis. It measures how far your observed sample data deviates from the null hypothesis, expressed in units of standard error.
The Test Statistic Formula
For testing a single population mean, the formula is:
- x̄ (Sample Mean): The average value calculated from your data sample.
- μ₀ (Hypothesized Mean): The value claimed by the null hypothesis (the "status quo").
- s (Standard Deviation): The measure of spread in your data.
- n (Sample Size): The total number of observations in your data set.
- s / √n (Standard Error): The standard deviation of the sampling distribution.
Step-by-Step Example
Imagine a lightbulb manufacturer claims their bulbs last 1,000 hours (μ₀ = 1000). You test 36 bulbs (n = 36) and find they last an average of 980 hours (x̄ = 980) with a standard deviation of 50 hours (s = 50).
- Find the difference: 980 – 1000 = -20
- Calculate Standard Error: 50 / √36 = 50 / 6 = 8.33
- Divide the difference by error: -20 / 8.33 = -2.40
The resulting test statistic is -2.40. This means your sample mean is 2.40 standard errors below the hypothesized mean.
When to use Z vs. T?
While the calculation for the test statistic itself is identical, the distribution you use for comparison depends on your sample size:
- Z-test: Used when the population standard deviation is known or the sample size is large (n > 30).
- T-test: Used when the population standard deviation is unknown and the sample size is small (n < 30).