Test Statistic Calculator

This test statistic calculator computes the z, t, paired t, proportion, correlation t, chi-square or F statistic and shows the formula with your numbers filled in.

Checks on your data

  • The decision depends on the significance level you choose in advance. 0.05 is shown as a common default.
  • Each test assumes independent observations; t tests assume roughly normal data or a reasonably large sample.

Results

Test statistic t
2.3962862
Degrees of freedom
29
p-value (two-tailed)
0.0232339
Reject H₀ at α = 0.05?
Yes
Cohen's d
0.4375
Distribution of t under H₀ with the p-value shaded
-4-2024t = 2.396t
Show step-by-step solution
  1. Formula: t = (x̄ − μ₀) ÷ (s ÷ √n).
  2. Substitute: (103.5 − 100) ÷ (8 ÷ √30).
  3. Result: t = 2.3962862, df = 29.
  4. p-value = 0.0232339.
Testsz, t, paired, proportion, r, F, χ²
GivesStatistic, df, p-value
Effect sizeCohen's d
Default α0.05

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

  1. Pick the test.
  2. Enter your summary statistics.
  3. Read the statistic with the formula filled in.
  4. Compare the p-value with α.

Test Statistic Formula

t (one mean)

t=xˉ−μ0s/nt=\frac{\bar x-\mu_0}{s/\sqrt n}

z (proportion)

z=p^−p0p0(1−p0)/nz=\frac{\hat p-p_0}{\sqrt{p_0(1-p_0)/n}}

Chi-square

χ2=∑(O−E)2E\chi^2=\sum\frac{(O-E)^2}{E}

Test Statistic Variables Explained

SymbolMeaningNotes
x̄Sample mean
μ₀Hypothesised mean
sSample standard deviation
nSample 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:

  1. Formula: t = (x̄ − μ₀) ÷ (s ÷ √n).
  2. Substitute: (103.5 − 100) ÷ (8 ÷ √30).
  3. Result: t = 2.3962862, df = 29.
  4. 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.

Related calculators

Last updated 2026-11-09. See our disclaimer.