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.
How to Read a Test Statistic
A test statistic measures how far your data are from the null hypothesis, in units of standard error. For a sample of 30 with mean 103.5 and SD 8 tested against μ₀ = 100, the standard error is 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 at α = 0.05 you reject H₀. A larger absolute statistic means stronger evidence against the null. Cohen’s d describes the size of the difference in SD units, which p-values do not.
Where Test Statistic Is Used
One-sample t
Compare a mean with a target value.
Two-sample and paired tests
Compare two groups or before-and-after data.
Proportions and correlation
Test a proportion or a correlation.
Chi-square
Get χ² from observed and expected counts.
Common Test Statistic Mistakes to Avoid
- Pick the test that matches your design before computing anything.
- For paired data, use the differences, not the two columns.
- A small p-value does not mean a large effect. Check Cohen’s d too.
- The tests assume independent observations.
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?
It is a number computed from the data that measures how far the result is from what the null hypothesis predicts. Its sampling distribution gives the p-value.
How do I calculate a test statistic?
For a mean, t = (x̄ − μ₀) ÷ (s ÷ √n). Other tests have their own formulas, and the calculator applies the right one.
z or t?
Use t when the standard deviation is estimated from the sample. Use z when the population SD is known, or for tests of proportions with large samples.
How is the p-value found?
It is the probability, under the null, of a statistic at least as extreme as yours. It comes from the t, z, χ² or F distribution with the right degrees of freedom.