# Choosing the Right Statistical Test

Selecting the correct statistical test depends on:

- The type of your dependent variable (numeric or categorical)
- The number of groups
- Whether samples are paired or independent
- Whether assumptions like normality hold

This guide provides a structured decision pathway.

---

# Step 1 — Identify Your Dependent Variable Type

## Is your outcome numeric (continuous)?
Examples: test scores, reaction time, blood pressure

If **yes**, go to **Step 2A**.

---

## Is your outcome categorical (binary or multi-class)?
Examples: Yes/No, Disease/No Disease, type of customer

If **yes**, go to **Step 2B**.

---

# Step 2A — Numeric Outcome

## How many groups are you comparing?

### 2 groups — independent
Use:
- [Independent Samples T-Test](ttests/ttest-independent.md)
- If non-normal: [Mann–Whitney U Test](ttests/mann-whitney.md)

---

### 2 groups — paired
Use:
- [Paired T-Test](ttests/ttest-paired.md)
- If non-normal: [Wilcoxon Signed-Rank Test](ttests/wilcoxon.md)

---

### 3 or more groups — independent
Use:
- [One-Way ANOVA](anova/one-way-anova.md)
- If non-normal: [Kruskal–Wallis Test](anova/kruskal-wallis.md)

Post-hoc comparisons and Bonferroni correction applied automatically.

---

### 3 or more groups — repeated measures
Use:
- [Repeated Measures ANOVA](anova/repeated-anova.md)
- If non-normal: [Friedman Test](anova/friedman.md)

---

### Two categorical factors (2×2 or 2×k design)
Use:
- [Two-Way ANOVA](anova/two-way-anova.md)
- If non-normal: [Scheirer–Ray–Hare Test](anova/scheirer-ray-hare.md)

---

### Multiple numeric outcomes across groups simultaneously
Use:
- [MANOVA](anova/manova.md)

---

### Numeric outcome + continuous covariate to control for
Use:
- [ANCOVA](anova/ancova.md)

---

# Step 2B — Categorical Outcome

### Association between two categorical / binary variables
Use:
- [Chi-Square Test](categorical/chi-square.md)

---

### Binary outcome — predict probability from predictors
Use:
- [Multiple Logistic Regression](regression/logistic.md)

### Outcome with 3 or more unordered categories
Use:
- [Multinomial Logistic Regression](regression/multinomial-logistic.md)

### Evaluate a binary classifier (sensitivity / specificity / AUC)
Use:
- [ROC Curve Analysis](diagnostic/roc-curve.md)

---

# Step 3 — Relationships Between Variables

### Both numeric — linear relationship?
- [Pearson Correlation](correlation/pearson.md)
- If non-normal: [Spearman Correlation](correlation/spearman.md)

### Both numeric — controlling for other variables?
- [Partial Pearson Correlation](correlation/partial-pearson.md)
- [Partial Spearman Correlation](correlation/partial-spearman.md)

---

# Step 4 — Prediction / Modelling

### Predict a numeric outcome from **one** variable?
- [Simple Linear Regression](regression/simple-linear.md)
- If non-normal / outliers present: [Theil–Sen Regression](regression/theil-sen.md)

### Predict a numeric outcome from **multiple** variables?
- [Multiple Linear Regression](regression/multiple-linear.md)

### Predict a binary outcome?
- [Multiple Logistic Regression](regression/logistic.md)

### Predict a multi-class outcome?
- [Multinomial Logistic Regression](regression/multinomial-logistic.md)

### Not sure which predictors matter most?
- [Automatic Predictor Selection](predictors/auto-predictor-selection.md)

---

# Step 5 — Time-to-Event Data

Use:
- [Kaplan–Meier Survival Analysis](survival/kaplan-meier.md)

---

# Summary Decision Tree

```
Start
 |
 +-- Numeric outcome?
 |    |
 |    +-- 2 groups, independent    --> T-Test  /  Mann-Whitney U
 |    +-- 2 groups, paired         --> Paired T-Test  /  Wilcoxon
 |    +-- 3+ groups, independent   --> ANOVA  /  Kruskal-Wallis
 |    +-- 3+ groups, repeated      --> Repeated ANOVA  /  Friedman
 |    +-- 2 categorical factors    --> Two-Way ANOVA  /  Scheirer-Ray-Hare
 |    +-- Multiple outcomes        --> MANOVA
 |    +-- + covariate to control   --> ANCOVA
 |    +-- Predict from 1 variable  --> Simple Linear  /  Theil-Sen
 |    +-- Predict from N variables --> Multiple Linear Regression
 |
 +-- Categorical outcome?
 |    |
 |    +-- 2 categorical variables  --> Chi-Square Test
 |    +-- Binary outcome           --> Logistic Regression
 |    +-- 3+ categories            --> Multinomial Logistic Regression
 |    +-- Evaluate classifier      --> ROC Curve Analysis
 |
 +-- Relationship between numeric variables?
 |    +-- Simple                   --> Pearson  /  Spearman
 |    +-- Control for other vars   --> Partial Pearson  /  Partial Spearman
 |
 +-- Time-to-event data            --> Kaplan-Meier
 +-- Unknown predictors            --> Automatic Predictor Selection
```
