Regression models
Your outcome type picks the model. Your question picks the covariates.
Every model below answers the same question: how does the outcome change with each factor, holding the others fixed? They differ in what kind of outcome they handle, and so in what the coefficient means.
| Outcome | Model | You report | In R |
|---|---|---|---|
| Continuous BP, HbA1c, length of stay | Linear regression | Difference in means per unit / vs reference | lm() |
| Continuous BP, HbA1c, length of stay | ANCOVA (adjusting for baseline) | Adjusted difference in means | lm() |
| Continuous BP, HbA1c, length of stay | Two-way ANOVA | Differences in means, and the interaction | lm() / aov() |
| Binary Death, complication, readmission | Conditional logistic regression | Odds ratio | survival::clogit() |
| Binary Death, complication, readmission | Log-binomial regression | Prevalence ratio or risk ratio | glm(family = binomial(link = "log")) |
| Binary Death, complication, readmission | Logistic regression | Odds ratio | glm(family = binomial) |
| Categorical Blood group, other unordered categories | Multinomial logistic regression | Odds ratio per category versus a reference category | nnet::multinom() |
| Time-to-event Survival, relapse, time to discharge | Cox proportional hazards regression | Hazard ratio | survival::coxph() |
| Time-to-event Survival, relapse, time to discharge | Competing risks: cumulative incidence and Fine-Gray | Subdistribution hazard ratio; cumulative incidence | tidycmprsk::crr() |
| Counts and rates Exacerbations, admissions per year | Poisson and negative binomial regression | Rate ratio | MASS::glm.nb() |
| Ordinal mRS, pain scores, Likert items | Proportional odds (ordinal logistic) regression | Common odds ratio | ordinal::clm() |
| Any of the above, measured repeatedly visits, wards, hospitals | Linear mixed model or GEE and mixed-effects logistic regression | Same as above | lme4::lmer() / lme4::glmer() / geepack::geeglm() |
Choosing covariates
- Decide before you look at the data, based on what causes what.
- Draw it as a diagram (a DAG) and adjust for confounders.
- Don't adjust for things on the causal path, like a mediator.
- For binary and survival outcomes, the number of events limits how many covariates you can fit, not the number of patients.
Reading the output
- A coefficient is the effect of that factor with the others held fixed.
- An odds ratio of 2 doubles the odds, not the risk. With common outcomes the two differ a lot.
- A hazard ratio is about the rate of events over time, not the final proportion.
- Always give the 95% confidence interval next to the estimate.
Avoid selecting variables by stepwise or by p-value
It tends to overfit, biases the estimates and makes confidence intervals too narrow. Choose variables in advance, for example with a causal diagram (DAG).
ADVANCED
Beyond the standard models
Copulas for dependence between two outcomes, joint models for a biomarker and survival together, competing risks in depth, and Bayesian analysis. Explained, with a clear note on when to bring in a statistician.
Read the overview- Copulas
- Joint models
- Competing risks
- Bayesian analysis