Which Test?

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.

OutcomeModelYou reportIn R
Continuous
BP, HbA1c, length of stay
Linear regressionDifference in means per unit / vs referencelm()
Continuous
BP, HbA1c, length of stay
ANCOVA (adjusting for baseline)Adjusted difference in meanslm()
Continuous
BP, HbA1c, length of stay
Two-way ANOVADifferences in means, and the interactionlm() / aov()
Binary
Death, complication, readmission
Conditional logistic regressionOdds ratiosurvival::clogit()
Binary
Death, complication, readmission
Log-binomial regressionPrevalence ratio or risk ratioglm(family = binomial(link = "log"))
Binary
Death, complication, readmission
Logistic regressionOdds ratioglm(family = binomial)
Categorical
Blood group, other unordered categories
Multinomial logistic regressionOdds ratio per category versus a reference categorynnet::multinom()
Time-to-event
Survival, relapse, time to discharge
Cox proportional hazards regressionHazard ratiosurvival::coxph()
Time-to-event
Survival, relapse, time to discharge
Competing risks: cumulative incidence and Fine-GraySubdistribution hazard ratio; cumulative incidencetidycmprsk::crr()
Counts and rates
Exacerbations, admissions per year
Poisson and negative binomial regressionRate ratioMASS::glm.nb()
Ordinal
mRS, pain scores, Likert items
Proportional odds (ordinal logistic) regressionCommon odds ratioordinal::clm()
Any of the above, measured repeatedly
visits, wards, hospitals
Linear mixed model or GEE and mixed-effects logistic regressionSame as abovelme4::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