The outcome and predictor matrix
Two facts pick most tests: what kind of outcome you measured, and what you are comparing it across. Read the matrix once and you can place most methods.
What runs in CodeSplash
- Two-sample t-test (Welch / Student, or z test) Verified in Python and R
- One-way ANOVA (Welch / classic) Verified in Python and R
- Linear regression (OLS) Verified in Python and R
- Logistic regression (binary outcome) Verified in Python and R
- Count regression (Poisson / negative binomial) Verified in Python and R
- Ordinal logistic regression (proportional odds) Verified in Python and R
- Two independent proportions (z, Fisher, Boschloo, Barnard, non-inferiority) Verified in Python and R
- χ² test of independence Verified in Python and R
- Correlation test (Pearson / Spearman / Kendall) Verified in Python and R
- Log-rank test (compare survival curves) Verified in Python and R
- Cox proportional hazards regression Verified in Python and R
- Mann–Whitney U test Verified in Python and R
- Kruskal–Wallis test Verified in Python and R
You will be able to
- Classify outcomes as continuous, binary, count, ordinal or time to event
- Use the outcome and predictor to narrow down to a method
- Explain why the matrix chooses a starting point, not the final answer
Read first
First, what did you measure?
ReadThe type of the outcomeVariable typesWhether a column holds numbers, categories, ordered categories, yes/no values, dates or text; it decides which methods fit. sets the family of methods.
| Outcome | Looks like |
|---|---|
| Continuous | Blood pressure, revenue, time on page |
| Binary | Converted or not, alive or dead |
| Categorical | Blood type, product chosen |
| Ordinal | A 1–5 rating, mild/moderate/severe |
| Count | Complaints per month, seizures per year |
| Time to event | Days until churn, with some still waiting |
Watch out for numbers that aren't continuous. A 1–5 rating stored as an integer is ordinal. Hours until an event, where some haven't happened, are not ordinary numbers either: those rows are censoredCensoringFollow-up ended before the event happened, so you only know the event time is later than observed..
Continuous outcomes
Read| Across | Method |
|---|---|
| One sample against a value | One-sample t |
| Two groups | Welch's t, Mann–Whitney |
| Several groups | ANOVA, Kruskal–Wallis |
| A continuous variable | Correlation, simple regression |
| Several predictors | Multiple regression |
Each row has a parametric version and a robust or rank-based partner. The choice between them is a Step 3 question, not a Step 1 one.
Other outcomes
Read| Outcome | Two groups | With several predictors |
|---|---|---|
| Binary | Two-proportion z, Fisher | Logistic regression |
| Categorical | Chi-square | Multinomial regression |
| Ordinal | Mann–Whitney | Ordinal regression |
| Count | Poisson rate test | Poisson or negative binomial |
| Time to event | Log-rank | Cox regression |
Read across a row, and you see that the second column is the third column with one binary predictor.
Find the pattern
PredictPredict first
A yes/no outcome, with age and smoking as predictors, and everyone followed for the same length of time. Which regression?
Reveal
Logistic. The outcome is binary and the follow-up is complete. If follow-up varied and some people had not yet had the event, time to event would be the better framing: Cox.
Where the matrix stops
ReadThe matrix gives you a starting point. Three things can overrule it:
- Design. Pairs, repeats and clusters change the method in every cell.
- Assumptions. A check may send you to a robust partner.
- Your actual question. Do you want the mean, a median, or a difference anywhere in the distribution?
So read the matrix as "this is where to start thinking". The Test Chooser combines all of this with facts from your own columns.
Continuous outcome: linear regression · Statistics GuideUse the matrix
CheckpointCheck yourself
Monthly complaint counts per store, with stores open for different numbers of days. You want to compare two regions. Where do you start?
Show the answer
Answer: b
Counts with differing exposure call for rates. In CodeSplash, the Compare card's Exposure (time at risk) role routes you to rates.poisson.
Check yourself
Customers rate support from 1 to 5, and you want to compare two teams. Which is the most defensible starting point?
Show the answer
Answer: a
An ordered scale has rank information without equal spacing. A t test is often used and can be reasonable, but ordinal methods make no spacing assumption.
Check yourself
Patients are followed from surgery. Some die during the study, and others are alive at the end. Your outcome is survival. Which family?
Show the answer
Answer: c
The patients still alive have censored times. Dropping or ignoring them biases the result, and logistic regression throws away when the events occurred.
See it in your data
In the appOpen Academy → Key and switch to Tables to browse the guide's branches as lists. Then bring a real column to the Test Chooser, and see which of these cells it lands on.
Recap
Recap- Outcome type and what you compare across pick the starting cell.
- Every cell has a robust or rank-based partner, for Step 3.
- Design, assumptions and the exact question can all overrule the matrix.
Concepts in this lesson