What Is a Test Statistic? Definition, Types & Examples

A test statistic is a single number calculated from your data that measures how far the data stray from what you would expect if nothing interesting were going on. It boils a whole data set down to one value, which makes it the bridge between raw numbers and the yes-or-no call a hypothesis test has to make. Different questions call for different test statistics, from comparing averages to comparing counts, but nearly all of them share one idea: the size of an effect measured against the noise around it.1Wikipedia. Student’s t-test – Wikipedia

What a Test Statistic Measures

Every hypothesis test begins with a null hypothesis, the default claim that there is no difference or no effect. For example, two diets might produce the same average weight loss. The test statistic compares your data with what you would expect to see if that claim were true.2Minitab Support. What is a test statistic?

To do that, the statistic summarizes the data using its center, its spread, the sample size, and how many variables the model uses.3Scribbr. Test statistics | Definition, Interpretation, and Examples So the same difference in averages can give a large statistic in a big, tidy data set and a small one in a small, messy data set. The statistic is then used to work out the p-value, which feeds the decision to reject the null hypothesis or not.3Scribbr. Test statistics | Definition, Interpretation, and Examples

The easiest mental picture is signal over noise. The top of most formulas is the signal, the gap you observed. The bottom is the noise, how much that gap would wobble by chance. A large ratio means the signal stands out clearly. A ratio near zero means the gap is about the size chance alone would produce.

A reported value such as t = 2.4 means the data sit 2.4 noise-units away from what the null hypothesis predicts. The sign of t or z tells you the direction of the gap, such as which group’s average was higher. F and chi-square can never be negative, because they square or total up gaps.

A big statistic is not the same as a big effect. A large value says the effect is hard to blame on chance, not that it is large or important. Huge samples can make tiny, unimportant differences produce large statistics, so check the actual difference alongside the statistic.

A statistic can’t be judged alone; it has to be compared with how that statistic behaves by chance, which is the job of the p-value and critical value covered below. That is why a t of 2.4 and an F of 3.30 can’t be compared directly: each type has its own scale and its own chance distribution.

The Main Types of Test Statistics and When Each Is Used

The z-statistic is the sample average minus the population average, divided by the population standard deviation over the square root of the sample size.7GeeksforGeeks. Z-test: Formula, Types, Examples That bottom part is called the standard error: how much a sample average typically wobbles from sample to sample.8Wikipedia. Z-test So z tells you how many standard errors your sample average sits from the expected average.8Wikipedia. Z-test A plain z-score for a single value, (x − μ)/σ, measures distance for one data point and is not the same as the test version.9Investopedia. What Is a Test Statistic? Definition, Types & Examples

The t-statistic is the same idea with an estimated spread. In a one-sample t-test the top is the sample average minus the expected average, and the bottom is the standard error estimated from the sample itself.1Wikipedia. Student’s t-test – Wikipedia1Wikipedia. Student’s t-test – Wikipedia

To tell them apart on a homework problem, check what spread is given. If the problem states the population standard deviation, use z. If it gives only the standard deviation computed from your sample, use t. Software labels the test, and a t result usually comes with a degrees-of-freedom value while a z result does not. With a large sample the two answers come out nearly the same, so mixing them up there rarely changes the conclusion.

The F-statistic is a ratio of two kinds of variation. In one-way ANOVA, F equals the variation between the group averages divided by the variation within the groups.4Minitab Blog. Understanding Analysis of Variance (ANOVA) and the F-test The top measures how far group averages spread around the overall average, and the bottom measures how far individual points sit from their own group’s average.10Statistics By Jim. How F-tests work in Analysis of Variance (ANOVA) In one example with four groups averaging 11.2, 8.9, 10.7 and 8.8, F came out at 3.30, meaning the between-group variation was 3.3 times the within-group variation.10Statistics By Jim. How F-tests work in Analysis of Variance (ANOVA)

The chi-square statistic adds up gaps between observed and expected counts. For each category you subtract the expected count from the observed count, square it, divide by the expected count, and add the results.11Math is Fun. Chi-Square Test It is zero when counts match expectations exactly and grows as they drift apart.12mgimond.github.io. Comparing frequencies: Chi-Square tests It is the standard tool for tables of counts, such as yes/no answers split by age group.5Wikipedia. Chi-squared test

Roll a die 60 times; if it is fair, you expect each face about 10 times. If the six comes up 16 times, its contribution is (16 − 10)² / 10 = 3.6, because the gap of 6 is squared to 36 and divided by 10. You compute the same kind of contribution for the other five faces, then add all six. That total is the chi-square statistic. Squaring matters because a face that came up too often and one that came up too rarely would otherwise cancel out and hide a lopsided die.

Rank-based statistics are not a simple stand-in for t. The Mann-Whitney test compares whole distributions, not just averages, so it can flag groups whose spread or shape differs even when the averages match.13Journal of Applied Statistics. Robustness of the t and U tests under combined assumption violations

From Test Statistic to P-Value to Decision

To get a p-value, you need to know how the test statistic would be spread out if the null hypothesis were true.14Omni Calculator. What Is a Test Statistic? Definition, Types & Examples The p-value is the probability of getting a statistic at least as extreme as yours under that assumption.14Omni Calculator. What Is a Test Statistic? Definition, Types & Examples Working out that chance distribution is often the hard part, even when the statistic itself is easy to compute.15Wikipedia. p-value

Critical values give the same decision without a p-value. Alpha, the significance level, is the risk you accept of wrongly rejecting a true null hypothesis, usually 0.01, 0.05 or 0.10.16Statistics Online. S.3.1 Hypothesis Testing (Critical Value Approach) The critical value is the point on the statistic’s distribution that cuts off that alpha-sized tail.16Statistics Online. S.3.1 Hypothesis Testing (Critical Value Approach) With an alpha of 5%, the most extreme 5% of possible values form the rejection region.17Statistics How To. Rejection Region Definition Statistics How / Statistics How To If your statistic lands beyond the critical value, you reject the null hypothesis. For a two-sided z-test at 5% alpha, the critical values are about −1.96 and +1.96.

Say a two-group comparison gives t = 2.4. For a moderate sample size, the critical value at 5% alpha is roughly 2.0, so you compare 2.4 against that cutoff. Because 2.4 lands beyond 2.0, it falls in the rejection region, which means the p-value is below 0.05 and you reject the null hypothesis. The honest wording is that the data give evidence of a difference between the groups, not proof, since a true null can still occasionally produce a result this extreme.

One-tailed and two-tailed tests change the p-value. A one-tailed test looks for a difference in one stated direction, such as “the new diet loses more weight,” and counts only that end of the distribution. A two-tailed test counts extreme values on both sides, so it catches a difference in either direction. For a symmetric statistic such as t or z, when the result falls in the predicted direction, the two-tailed p-value is twice the one-tailed value, which makes the two-tailed test harder to pass. The direction must be chosen before seeing the data; picking it afterward to get a smaller p-value defeats the purpose of the test.

Why Sample Size and Degrees of Freedom Change the Verdict

Degrees of freedom (df) are usually tied to sample size, and they set the shape of the t distribution used to get the p-value.18Investopedia. What Is a Test Statistic? Definition, Types & Examples Small samples carry more uncertainty about the true spread, so the t distribution has heavier tails than the normal curve.19statisticsfundamentals.com. What Is a Test Statistic? Definition, Types & Examples With low degrees of freedom, it is therefore harder to reach statistical significance.20SixSigma.us. Degrees of Freedom (df) in Statistics. Everything to Know!19statisticsfundamentals.com. What Is a Test Statistic? Definition, Types & Examples

A t with very low df, such as t(5), is less convincing than the same t with more data. Once df is around 30 or more, you can read t roughly as if it were z.

Chi-square and F have their own rules. With 1 degree of freedom the chi-square distribution is strongly lopsided, and it becomes more balanced as df grows.19statisticsfundamentals.com. What Is a Test Statistic? Definition, Types & Examples The average chi-square value expected by chance equals its degrees of freedom.19statisticsfundamentals.com. What Is a Test Statistic? Definition, Types & Examples So a chi-square of 5 is unremarkable with 5 df but notable with 1 df. The F distribution needs two df values, one for the top of the ratio and one for the bottom.19statisticsfundamentals.com. What Is a Test Statistic? Definition, Types & Examples

Software often writes results like t(18) = 2.4 or F(3, 36) = 3.30, where the numbers in brackets are the degrees of freedom. In a one-sample t-test, df is the sample size minus one, so t(18) there would point to a sample of 19. An F result lists two df values: the first goes with the top of the ratio (related to the number of groups) and the second with the bottom (related to the number of observations). You need df to look up the right critical value in a table, because the cutoff for the same alpha changes as df changes.

When a Test Statistic Can Mislead You

Many standard methods for comparing group averages assume the groups have similar spreads.21PubMed Central. A Robust Procedure for Comparing Multiple Means under Heteroscedasticity in Unbalanced Designs When spreads differ, false positives can turn up far more often than the chosen alpha promises.21PubMed Central. A Robust Procedure for Comparing Multiple Means under Heteroscedasticity in Unbalanced Designs

The reason is that a standard t-test pools the spreads of the groups into one estimate, which is only sensible if the groups vary by similar amounts. When one group is much more spread out than another, the pooled estimate misstates the noise, and the statistic ends up too large or too small for what the data really show. The problem is worst when the group with the larger spread is also the smaller group. When groups differ in both spread and size, a Welch t-test is a safer choice than the standard t-test,13Journal of Applied Statistics. Robustness of the t and U tests under combined assumption violations because it does not pool the spreads and so keeps its error rate near the chosen alpha.

Running many tests inflates the chance of a fluke. Each test at 5% alpha carries its own risk of a false positive, and those risks add up.22PubMed Central. What is the proper way to apply the multiple comparison test? Three comparisons at 5% each give about a 14% chance of at least one false positive,22PubMed Central. What is the proper way to apply the multiple comparison test? well above the 5% you thought you accepted.

Researchers often lower alpha for each test when running many, to keep the overall error rate in check.23Methods in Psychology. Use and misuse of corrections for multiple testing The cost is that each single test becomes harder to pass. In studies testing thousands of markers, statistics can also run systematically too large, which produces many false discoveries.24PubMed Central. Test-statistic inflation in methylome-wide association studies

Before trusting any one number, plot the data to look for heavy skew or outliers, compare each group’s spread before running a standard t-test or ANOVA, and count how many tests you ran before reading any single p-value.

Ways to Get a Test Statistic’s Distribution Without Formulas

When no standard distribution fits, simulation can supply one. A permutation test builds the distribution of a test statistic under the null hypothesis by simulation.25Computational Statistics I. Chapter 4 Resampling: permutation testing and bootstrap The bootstrap and jackknife estimate a statistic’s variability from resampled subsets of the data rather than from assumptions about its shape.26Wikipedia. Resampling (statistics) These approaches suit odd statistics or messy data where standard formulas don’t apply.

A permutation test on two small groups shows the logic. Start by computing the difference in averages between your two real groups; this is the observed statistic. Pool all the values together and shuffle them randomly into two new groups of the original sizes, then compute the difference in averages again. Repeat the shuffle thousands of times and count how often a shuffled difference is as large as or larger than the real one. That share of shuffles is the p-value, and it needs no distribution table because your own data supplied the chance distribution.