What Is Test Statistic?
A test statistic measures how far your sample result is from what the null hypothesis predicts, in units of standard error. The larger it is in absolute value, the stronger the evidence against H₀.
Pick the test, enter your summary values and the calculator shows the formula, the substitution, the degrees of freedom, the p-value and, where it applies, Cohen’s d. A curve shows the distribution under H₀ with the p-value area shaded.
The sections below give the formulas, a worked t example and guidance on choosing between z and t.
How to Use the Test Statistic Calculator
- Pick the test.
- Enter your summary statistics.
- Read the statistic with the formula filled in.
- Compare the p-value with α.
Test Statistic Formula
t (one mean)
z (proportion)
Chi-square
Test Statistic Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| x̄ | Sample mean | |
| μ₀ | Hypothesised mean | |
| s | Sample standard deviation | |
| n | Sample size |
Test Statistic Worked Example
A sample of 30 has mean 103.5 and SD 8 and we test μ₀ = 100. The standard error is 8 ÷ √30 = 1.4606, so t = 3.5 ÷ 1.4606 = 2.396 with 29 degrees of freedom. The two-tailed p-value is about 0.023, so H₀ is rejected at 5 %.
With the example values loaded in the calculator above, the steps are:
- Formula: t = (x̄ − μ₀) ÷ (s ÷ √n).
- Substitute: (103.5 − 100) ÷ (8 ÷ √30).
- Result: t = 2.3962862, df = 29.
- p-value = 0.0232339.
Result: Test statistic t = 2.3962862; p-value (two-tailed) = 0.0232339.
Where Test Statistic Is Used
Homework
Check each step of a test.
Lab reports
Compute the statistic from summary data.
Choosing a test
Compare z, t, F and chi-square.
Effect size
Get Cohen’s d with the test.
Common Test Statistic Mistakes to Avoid
- Decide the alternative before looking at data.
- Use t unless σ is truly known.
- Report the effect size as well as p.
Test Statistic Terms and Definitions
- Test statistic
- A number computed from the sample that measures how far the data are from H₀ in standard-error units.
Test Statistic FAQs
What is a test statistic?
A value computed from your sample that is compared with a known distribution to judge H₀.
How do I calculate a test statistic?
Take the difference between the sample estimate and the hypothesised value, then divide by its standard error.
z or t?
Use z when the population SD is known or for proportions; use t when you estimate the SD from the sample.
How is the p-value found?
From the tail area of the distribution beyond the test statistic.