1Selecting the Appropriate Statistical Test
▶
Choosing the right statistical test is one of the most consequential decisions in any quantitative study. Apply the wrong test and even perfectly collected data can produce p-values that mislead, conclusions that fail peer review, or — more dangerously — real-world decisions grounded in faulty inference. A structured decision-making framework removes much of the guesswork by turning test selection into a reproducible, step-by-step reasoning process rather than an ad hoc judgment call. This topic walks through every layer of that framework in depth: how data type, sample size, distributional assumptions, sample independence, number of groups, and the precise form of the research question all combine to point toward one defensible test choice.
The Decision-Making Framework Overview
The framework begins well before any data are examined. The first task is to articulate the research question as precisely as possible, because the wording of that question already constrains the universe of appropriate tests. "Is the average resting heart rate different between runners and non-runners?" is a question about a mean difference between two groups. "Is there an association between smoking status and lung cancer diagnosis?" is a question about the relationship between two categorical variables. "Does the distribution of blood types in this city match the known national distribution?" is a goodness-of-fit question. Each phrasing points in a different statistical direction before a single data point is inspected.
Three master decision points run through the entire framework:
- Nature of the data — what kind of variable is being measured and at what level of measurement?
- Structure of the samples — how many groups are involved, and are observations across groups independent of one another or systematically linked?
- Distributional assumptions — does the data satisfy the conditions required by parametric tests, or do those conditions fail, requiring a non-parametric alternative?
Skipping any of these decision points is risky. A researcher who jumps straight to a t-test without verifying distributional assumptions may produce a p-value that is either too liberal (declaring significance when none exists) or too conservative (missing a real effect). A well-documented framework also functions as an audit trail: when reporting results, being able to show why a particular test was chosen — citing measurement level, sample structure, and assumption checks — substantially strengthens the credibility of the analysis.
Identifying Data Type and Measurement Level
Every variable lives at one of four levels of measurement, and that level is the single most important factor in narrowing the candidate tests. The four levels — nominal, ordinal, interval, and ratio — are not interchangeable, and treating a lower-level variable as though it were higher-level is one of the field's most common analytic errors.
- Nominal (categorical) variables classify observations into named groups with no implied order: blood type (A, B, AB, O), country of birth, treatment arm (drug vs. placebo). The only arithmetic meaningful here is counting frequencies. Tests designed for nominal data include the chi-square test of independence, the chi-square goodness-of-fit test, and Fisher's exact test.
- Ordinal variables have a meaningful rank order, but the gaps between ranks are not guaranteed to be equal. Pain rated on a 1–10 scale, educational attainment (high school / bachelor's / graduate), and Likert-scale responses ("strongly disagree" to "strongly agree") are ordinal. You can say rank 7 pain is worse than rank 4, but you cannot say the difference from 4 to 7 equals the difference from 1 to 4. Treating ordinal data as if it were continuous (e.g., computing a mean and running a t-test) risks distorting the test statistic because the assumed equal-interval structure does not hold. Non-parametric tests — Mann-Whitney U, Wilcoxon signed-rank, Kruskal-Wallis — use ranks rather than raw values and are therefore appropriate for ordinal outcomes.
- Interval and ratio variables are both continuous in the sense that equal numerical differences represent equal real-world differences. Ratio variables additionally have a true zero (e.g., body weight in kilograms, reaction time in milliseconds), while interval variables do not (e.g., temperature in Celsius, where 0°C does not mean "no temperature"). For practical test-selection purposes, interval and ratio variables are treated identically: they support parametric tests such as independent-samples t-tests, paired t-tests, ANOVA, Pearson correlation, and linear regression, provided distributional assumptions are satisfied.
A concrete example of the misclassification error: a researcher records patient satisfaction on a 5-point Likert scale (1 = very dissatisfied, 5 = very satisfied), computes a group mean of 3.4 vs. 2.9, and runs an independent-samples t-test. The t-test assumes the difference between adjacent scale points is constant — but is the psychological distance from "neutral" to "somewhat satisfied" the same as from "somewhat dissatisfied" to "neutral"? Almost certainly not. A Mann-Whitney U test comparing the rank-ordered satisfaction scores would be a more defensible choice.
Assessing Sample Size and Distributional Assumptions
Parametric tests such as the t-test and ANOVA rest on specific assumptions about the shape of the underlying population distribution — most critically, that the data (or the sampling distribution of the mean) follows a normal distribution. The good news is that the Central Limit Theorem (CLT) provides a practical safety net: as sample sizes grow, the sampling distribution of the mean approaches normality regardless of the population's shape. As a widely used rule of thumb, samples of n ≥ 30 per group usually satisfy normality requirements through the CLT, making parametric tests appropriate even when the raw data are modestly skewed.
With small samples — say, n < 15 to 20 per group — the CLT offers little protection, and the true shape of the population distribution matters directly. Before committing to a parametric test in this situation, the analyst should:
- Plot a histogram to visualize the empirical distribution's shape.
- Inspect a Q-Q (quantile-quantile) plot, which maps the observed quantiles against the quantiles expected from a theoretical normal distribution. Points following the diagonal reference line suggest normality; pronounced S-curves or heavy deviations signal departures.
- Consider a formal normality test such as the Shapiro-Wilk test (preferred for small samples) or the Kolmogorov-Smirnov test. Caution: with very small samples these tests have low power and may fail to detect non-normality; with very large samples they may flag trivial departures as significant. Formal tests should complement, not replace, visual inspection.
If strong evidence of non-normality exists — heavy skewness, extreme outliers, or a distribution with markedly heavier tails than the normal — a non-parametric test is safer because it makes no assumption about the population's distribution. Non-parametric procedures work by converting raw values to ranks and testing based on those ranks, sidestepping the normality requirement entirely.
Beyond normality, independent-samples t-tests and one-way ANOVA carry an assumption of homogeneity of variance (also called homoscedasticity): the variances within each group should be approximately equal. Levene's test formally evaluates this. If it is violated:
- For two groups, use Welch's t-test, which adjusts the degrees of freedom to account for unequal variances and is now recommended as the default by many statisticians even when variances look similar.
- For three or more groups, Welch's ANOVA or the Brown-Forsythe test are robust alternatives to standard one-way ANOVA.
Determining Independence vs. Dependence of Samples
The structural relationship between observations across groups is just as important as the measurement level of the outcome variable. The fundamental distinction is between independent samples and dependent (paired) samples.
Independent samples exist when each observation belongs exclusively to one group, and knowing the value of one observation gives no information about observations in the other group. Classic examples: randomly assigning 40 patients to Drug A and another 40 to Drug B (different people in each group); comparing exam scores between students taught by two different teachers. The appropriate tests are the independent-samples t-test (parametric) or the Mann-Whitney U test (non-parametric).
Dependent (paired) samples arise when each data point in Group 1 has a natural, one-to-one partner in Group 2. The pairing can come from:
- Repeated measures on the same subject — measuring the same patient's blood pressure before and after treatment. The same person appears in both groups, so the two measurements are correlated.
- Matching — deliberately pairing each participant in the treatment group with a control group participant who is identical (or very similar) on key variables like age and sex.
- Natural pairs — studying left- vs. right-eye visual acuity in the same individuals; comparing twins.
For dependent samples, use the paired t-test (parametric) or the Wilcoxon signed-rank test (non-parametric). These tests analyze the within-pair differences rather than the raw group values, which is critical because the pairing removes between-subject variability from the error term, making the test more sensitive.
Treating paired data as if it were independent is a serious error. Suppose 20 participants each provide a before-measurement and an after-measurement. A paired t-test works with 20 difference scores. An independent-samples t-test mistakenly treats this as 40 separate data points from two unrelated groups, ignoring the correlation within pairs. The result is a larger standard error and a less powerful test — meaning real effects are more likely to be missed. The reverse error (treating independent data as paired) is less common but distorts degrees of freedom and can produce overconfident results.
Considering the Number of Groups or Samples
Once data type and sample structure are established, the number of groups being compared determines which specific test applies. The table below summarizes the most common mapping:
| Outcome Variable | Number of Groups | Sample Structure | Parametric Test | Non-Parametric Alternative |
|---|---|---|---|---|
| Continuous | 2 | Independent | Independent-samples t-test | Mann-Whitney U |
| Continuous | 2 | Dependent (paired) | Paired t-test | Wilcoxon signed-rank |
| Continuous | 3 or more | Independent | One-way ANOVA | Kruskal-Wallis |
| Continuous | 3 or more | Dependent (repeated measures) | Repeated-measures ANOVA | Friedman test |
| Categorical (nominal) | 2 (2×2 table) | Independent | Chi-square or Fisher's exact | Fisher's exact (small n) |
| Categorical (nominal) | 2+ (larger table) | Independent | Chi-square test of independence | — |
| Continuous (two variables) | — | Same subjects | Pearson correlation / linear regression | Spearman correlation |
Two aspects of this table deserve elaboration. First, when comparing three or more group means with a continuous outcome, running multiple independent t-tests (one for each pair of groups) is tempting but incorrect. Each t-test carries its own Type I error rate (typically α = 0.05), and conducting many tests on the same dataset inflates the familywise error rate — the probability that at least one comparison will be falsely declared significant purely by chance. One-way ANOVA tests all groups simultaneously in a single omnibus test, controlling the Type I error rate at α. If ANOVA signals a significant overall difference, post-hoc tests (Tukey's HSD, Bonferroni correction, Scheffé's method) then identify which specific pairs differ, with appropriate correction for multiple comparisons.
Second, for categorical outcomes in a 2×2 table, the chi-square test requires that expected cell frequencies are sufficiently large (a common guideline is all expected counts ≥ 5). When this condition fails — which happens routinely with small samples or rare outcomes — Fisher's exact test is preferred because it computes the exact probability of observing a table as extreme as (or more extreme than) the one obtained, without relying on a large-sample approximation.
Aligning Test Choice with the Research Question
Even after data type, sample size, and group structure have been determined, the precise inferential goal embedded in the research question provides a final check. There are three broad inferential goals:
- Comparing group differences — the researcher wants to know whether a central tendency (usually the mean or median) differs across groups. This is where t-tests, ANOVA, Mann-Whitney U, and Kruskal-Wallis live.
- Assessing relationships or associations — the researcher wants to know whether two variables co-vary. For two continuous variables, Pearson correlation (or Spearman if ordinal or non-normal) quantifies the direction and strength of the linear relationship. For two categorical variables, the chi-square test of independence assesses association. When the goal is to predict one variable from another (or several others), regression analysis is appropriate.
- Testing goodness-of-fit — the researcher wants to know whether an observed frequency distribution matches a theoretically expected one. The chi-square goodness-of-fit test compares the observed count in each category to the expected count under the null hypothesis. Example: a geneticist predicting a 3:1 ratio of dominant to recessive phenotypes would use this test to evaluate whether observed offspring counts deviate significantly from that ratio.
The directionality of the hypothesis also matters. A two-tailed test evaluates whether the parameter differs from the null in either direction, splitting α equally across both tails of the distribution. A one-tailed test concentrates the entire α in one tail, testing for a difference in a specified direction only. One-tailed tests are appropriate only when a directional prediction is firmly grounded in theory or prior evidence before data collection — using them opportunistically after seeing the data constitutes p-hacking. For most research situations, the two-tailed test is the standard and safer choice.
Formulating the research hypothesis explicitly before any analysis also guards against confirmatory bias: if the hypothesis is written in advance, the researcher cannot unconsciously select a test simply because it produces a smaller p-value.
Practical Checklist for Final Test Selection
Bringing all the framework components together, the following five-step checklist provides a practical sequence for reaching a defensible test choice on any new dataset:
- Step 1 — Identify the outcome variable's measurement level. Is the primary outcome nominal, ordinal, or continuous (interval/ratio)? This immediately rules out large classes of tests. A nominal outcome points to chi-square or Fisher's exact; an ordinal outcome suggests non-parametric rank-based tests; a continuous outcome opens the door to t-tests, ANOVA, or their non-parametric equivalents, pending further checks.
- Step 2 — Determine the number of groups or samples. Are you comparing two groups or three or more? For two-group continuous comparisons, the choice is between variants of the t-test. For three or more, ANOVA (or its non-parametric equivalent) is needed. For categorical data, the size and structure of the contingency table guides the choice between chi-square and Fisher's exact.
- Step 3 — Establish whether samples are independent or paired/matched. If the same subjects appear in both (or all) conditions, or if observations are deliberately matched across groups, the samples are dependent and paired/matched designs must be used. Independent subjects in each group call for the independent-samples family of tests.
- Step 4 — Check sample size and distributional assumptions. Compute the sample size per group. Inspect Q-Q plots and histograms; consider Shapiro-Wilk if samples are small. Check variance homogeneity with Levene's test for multi-group comparisons. If normality is clearly violated and the sample is small, shift to the non-parametric equivalent of the intended parametric test.
- Step 5 — Confirm the test matches the specific inferential goal. Re-read the research question. Does the test chosen directly address whether there is a difference, a relationship, or a goodness-of-fit? Is the hypothesis one-tailed or two-tailed? If everything aligns, proceed. If not, revisit earlier steps.
To see the checklist in action, consider a study comparing anxiety scores (measured on a validated continuous scale) between a mindfulness intervention group (n = 18) and a waitlist control group (n = 16), where each participant appears in only one group. Step 1: continuous outcome — t-tests or non-parametric alternative are candidates. Step 2: two groups. Step 3: different participants in each group — independent samples. Step 4: n = 18 and 16 are small, so normality must be checked. Suppose Q-Q plots reveal modest right skewness in the intervention group with one notable outlier. This tips the decision toward the non-parametric option. Step 5: the research question asks whether the intervention reduces anxiety — a directional question with prior theoretical justification — so a one-tailed Mann-Whitney U test is selected. Every choice is documented, every assumption addressed.
The value of this framework is not just accuracy — it is transparency. Statistical analysis is a form of scientific argumentation, and every choice in that argument should be traceable to a principled reason. When reviewers, collaborators, or readers can follow the decision path from research question to test selection, the entire analysis becomes easier to evaluate, replicate, and trust.