ChaveryResearch Companion

Which statistical test should I use?

You do not need to know the name of a test to find it. What decides it is your study: what you are trying to find out, what kind of measurement you took, how many groups there are, and whether the same people were measured more than once.

Below is the whole of the question Chavery asks, written out. Start at the first question and follow your answers. Every ending names a test, says why that test fits, and lists what has to hold for it to be the right one — because a test recommended without its assumptions is a test that will be wrong for somebody.

Chavery does this from your data. On this page you follow the questions yourself. In the product the same tree runs against your master chart, checks the assumptions with Shapiro-Wilk and Levene’s test, and moves you to the alternative when one fails — so the answer comes from your numbers rather than your best guess about them.

The questions

What are you trying to find out?

Pick the option that best describes your objective. You do not need to know the name of a statistical test.

What kind of measurement are you comparing?

A number is something measured on a scale, like a score, weight or blood pressure. A category is a label, like improved / not improved.

What kind of values are the two things you are relating?

Ranked values are ordered categories, such as mild / moderate / severe, where the gaps between them are not equal.

Are these counts from the same participants, measured twice?

Choose 'the same participants' if each person appears twice - classified before and after, or judged by two methods. Choose 'different participants' if each person is counted once, in one group or the other.

What does the test being evaluated report?

Choose 'positive or negative' when the test gives a verdict. Choose 'a number' when it gives a value you would have to pick a cut-off for, like a biomarker concentration or a score.

What are you checking the consistency of?

Choose 'items' for a questionnaire where several questions measure the same thing. Choose 'raters' when different people (or repeat measurements) rated the same subjects.

What kind of outcome are you predicting?

A number is measured on a scale; a yes/no outcome has exactly two possibilities.

Which of these describes your comparison?

Choose the one that matches how the study was designed. If none does, go back and choose 'Compare a measurement between groups or time points'.

What do you want to know about the time to the event?

Participants who had not had the event when they were last seen are 'censored'; both methods use them for as long as they were followed.

What do you want to know about the series?

A series is one measurement taken again and again over time, in order: monthly admissions, daily temperature, yearly incidence. The order matters, so these methods are not for comparing groups. Most of them need every step recorded with no gaps.

What do you want to find out about the items?

Choose 'test' when you already know which items belong together (from the scale's manual or an earlier study); choose 'discover' when you do not.

What are you weighing the evidence for?

A Bayes factor says how much more likely the data are with an effect than without one, so it can also show evidence that there is no difference, which a p-value cannot.

How many groups or time points are you comparing?

Count the sets of measurements you want to compare. Comparing a before and an after measurement counts as two.

How many groups or time points are you comparing?

Count the groups you are comparing the ranking across - two treatment arms, or three visits.

What did each rater record?

Choose 'a measurement' for anything on a scale - a score, a length, a concentration. Choose 'a category' when each rater picked a label, like present / absent or mild / moderate / severe.

How should the forecast be built?

Both give a forecast with a 95% prediction interval, and both are checked on the data they were fitted to. They differ in what they assume about the pattern.

Are these measurements from the same participants?

Choose 'the same participants' if each person was measured twice, for example before and after treatment. Choose 'different participants' if you have two separate groups of people.

Are these measurements from the same participants?

Choose 'the same participants' if everyone was measured at every time point, for example baseline, 3 months and 6 months.

Are these ratings from the same participants?

Choose 'the same participants' if each person was graded twice, for example before and after treatment.

Are these ratings from the same participants?

Choose 'the same participants' if everyone was graded at every time point, for example baseline, 3 months and 6 months.

Where the questions end

Pearson correlation

Both variables are measured on a scale, so Pearson's correlation measures how strongly they move together in a straight line.

What has to hold:

If it does not: Spearman correlation.

Spearman correlation

At least one variable is a ranked category, so Spearman's correlation, which works on ranks rather than raw values, is appropriate.

If it does not: Pearson correlation.

Independent t-test

You are comparing a numerical measurement between two separate groups of participants, which is what an independent samples t-test is designed for.

What has to hold:

If it does not: Welch's t-test, Mann-Whitney U.

McNemar

Each participant was classified twice, so the two counts are linked and a chi-square test would treat them as though they came from different people. McNemar's test looks only at the participants who changed, which is where the evidence of a change actually is.

Chi-square

Each participant is counted once and the groups are separate, so you are comparing how counts are distributed across categories, which is what a chi-square test of independence assesses.

What has to hold:

If it does not: Fisher's exact.

Diagnostic accuracy

Comparing a positive/negative test against a gold standard gives sensitivity, specificity, predictive values and accuracy, each reported with a confidence interval.

ROC analysis

The test reports a number, so there is no single sensitivity and specificity to report - there is one pair for every cut-off. An ROC curve shows them all, and the area under it summarises how well the test separates the two groups whatever cut-off you eventually choose. Once you have chosen one, the accuracy panel reports that cut-off.

If it does not: Diagnostic accuracy.

Cronbach's alpha

Cronbach's alpha measures how consistently the items of a scale measure the same underlying construct.

Linear regression

Linear regression estimates how much the outcome changes for each unit change in the predictor, and can adjust for several predictors at once.

Logistic regression

With a yes/no outcome, logistic regression estimates the odds of the outcome occurring, reported as an odds ratio.

Ordinal logistic regression

With an ordered outcome, ordinal logistic regression estimates the odds of being in a higher category for each predictor, using the order without treating the grades as measured numbers.

If it does not: Multinomial logistic regression.

Multinomial logistic regression

With three or more unordered outcome categories, multinomial logistic regression compares each category with a reference category, giving a relative risk ratio for each predictor.

Factorial ANOVA

With two grouping factors, the question a factorial design exists to ask is whether the effect of one depends on the other - the interaction. A factorial ANOVA tests each factor and the interaction together; separate one-way ANOVAs never test the interaction at all.

ANCOVA

ANCOVA compares the groups after allowing for a covariate that also affects the outcome, such as the baseline score. It removes a baseline imbalance and makes the comparison more precise, provided the covariate relates to the outcome the same way in every group - which it checks.

MANOVA

Several related outcomes tested one at a time find a difference somewhere far more often than 5% of the time. MANOVA tests them together, with follow-up ANOVAs for each outcome.

Linear mixed model

The same participants were measured repeatedly, so their measurements are linked. A linear mixed model gives each participant their own baseline (a random intercept), compares groups over time, and keeps the visits a participant did attend when they missed one.

If it does not: Repeated-measures ANOVA.

Kaplan-Meier with log-rank test

Kaplan-Meier curves estimate the proportion still free of the event over time, using each participant for as long as they were followed, and the log-rank test compares the curves between groups.

If it does not: Cox regression.

Cox regression

Cox regression estimates how each factor changes the rate of the event - a hazard ratio - with the others held fixed, using censored participants for as long as they were followed.

If it does not: Kaplan-Meier with log-rank test.

Mann-Kendall trend test with Sen's slope

The Mann-Kendall test asks whether later readings tend to be above earlier ones, without assuming a straight line or normal errors, and Sen's slope gives the size of the trend. It leaves blanks out and does not need equal spacing.

If it does not: Interrupted time series (segmented regression), Seasonal decomposition.

Stationarity (ADF and KPSS)

A series that is stationary has the same mean and spread whenever it is looked at; many methods assume it. The augmented Dickey-Fuller and KPSS tests start from opposite hypotheses and are read together, and the same pair on the differenced series says how many differences are needed.

If it does not: Autocorrelation (ACF, PACF and Ljung-Box), Mann-Kendall trend test with Sen's slope.

Autocorrelation (ACF, PACF and Ljung-Box)

The autocorrelation and partial autocorrelation functions show how each reading relates to the ones before it, and the Ljung-Box test asks whether any of that is more than chance. It shows whether readings can be treated as independent and where a cycle repeats.

If it does not: Stationarity (ADF and KPSS), ARIMA forecast.

Seasonal decomposition

Classical decomposition splits the series into a trend, a repeating seasonal pattern and what is left, and gives the strength of the trend and of the seasonality. It needs the cycle length and two complete cycles.

If it does not: Autocorrelation (ACF, PACF and Ljung-Box), Exponential smoothing forecast.

Interrupted time series (segmented regression)

Segmented regression fits the trend before the intervention and asks whether the level, the slope or both changed when it began, allowing for autocorrelated errors. A before-and-after t-test of the same readings would ignore the trend and the order.

If it does not: Mann-Kendall trend test with Sen's slope.

Granger causality

Granger causality asks whether past values of one series improve the prediction of another beyond its own past, in both directions. It shows predictive precedence, not causation, and needs both series stationary.

If it does not: Autocorrelation (ACF, PACF and Ljung-Box).

Principal component analysis

Principal component analysis replaces many correlated items with a few weighted totals that keep most of their variation. It summarises the items; it does not claim a construct lies underneath them.

If it does not: Exploratory factor analysis.

Exploratory factor analysis

Exploratory factor analysis finds the underlying factors that would explain why the items correlate, without saying in advance which item belongs where, and tests whether that many factors is enough.

If it does not: Principal component analysis.

Confirmatory factor analysis

When you already know which items should measure which factor, confirmatory factor analysis tests that structure against your data and reports how well it fits.

Bayesian independent t-test

The Bayesian independent t-test reports a Bayes factor: how much more likely the data are with a difference between the groups than without one, so it can show evidence of no difference as well as of one.

If it does not: Independent t-test.

Bayesian paired t-test

The Bayesian paired t-test weighs the evidence for and against a change in the same participants, reported as a Bayes factor.

If it does not: Paired t-test.

Bayesian Pearson correlation

The Bayesian correlation weighs the evidence for and against a linear relationship between two measurements, reported as a Bayes factor.

If it does not: Pearson correlation.

One-sample t-test

You are comparing one set of measurements against a known value, so a one-sample t-test is appropriate provided the values are roughly normally distributed.

What has to hold:

If it does not: Wilcoxon signed-rank.

Intraclass correlation

The intraclass correlation coefficient measures how closely repeated measurements or different raters agree on the same subjects when what they record is a number on a scale.

Cohen's kappa

Each rater chose a label rather than measuring a quantity, so agreement is counted rather than correlated. Cohen's kappa measures how much the raters agreed beyond what chance alone would produce, which raw percentage agreement does not.

ARIMA forecast

ARIMA models each reading from the ones before it after differencing, with a seasonal part when there is a cycle, and forecasts with a prediction interval. The residuals are tested for any pattern the model missed.

If it does not: Exponential smoothing forecast, Autocorrelation (ACF, PACF and Ljung-Box).

Exponential smoothing forecast

Exponential smoothing (the ETS family, including Holt-Winters) weights recent readings most and carries a level, an optional trend and an optional seasonal pattern forward. The form is chosen by corrected AIC from those the series allows.

If it does not: ARIMA forecast, Seasonal decomposition.

Paired t-test

The same participants were measured twice, so the two measurements are linked. A paired t-test uses that pairing, which makes it more sensitive than treating the measurements as separate groups.

What has to hold:

If it does not: Wilcoxon signed-rank.

Repeated-measures ANOVA

Each participant was measured at three or more time points, so a repeated-measures ANOVA accounts for the fact that the measurements come from the same people.

What has to hold:

If it does not: Friedman test.

One-way ANOVA

You are comparing a numerical measurement across three or more separate groups. One-way ANOVA tests them together, avoiding the inflated error rate you would get from running several t-tests.

What has to hold:

If it does not: Kruskal-Wallis.

Wilcoxon signed-rank

Each participant was graded twice on a ranked scale. The Wilcoxon signed-rank test works on the direction and size of each person's change in rank, which is what an ordinal grade can support - the distance between 'mild' and 'moderate' is not a measured quantity.

Mann-Whitney U

You are comparing a ranked grade between two separate groups. Mann-Whitney U compares the ranks themselves rather than the means, which is the only thing an ordinal scale supports.

Friedman test

The same participants were graded on three or more occasions. The Friedman test ranks each participant's own grades across the occasions, so it uses the pairing without assuming the grades are measurements.

Kruskal-Wallis

You are comparing a ranked grade across three or more separate groups. Kruskal-Wallis compares the ranks across all of them at once, avoiding the inflated error rate of several pairwise tests.

Why the choice matters

Running a test whose assumptions your data does not meet does not produce no answer; it produces a confident wrong one. A t-test on skewed data will still print a p-value, and an examiner who asks how normality was checked will not accept that it looked fine. More on how a test is chosen, or what normality actually means.

Run the tree against your own data. Chavery answers these questions from your master chart and checks the assumptions before it runs anything. Create a free account — planning and the master chart cost nothing.