Presenting a model so it survives review

Today let's understand how to present a fitted model so that it survives a reviewer's questions, not just your own.

A model that only you can read is not finished. Somewhere between fitting it in R and sending it off for review, every number in it has to turn into something a stranger can check: a coefficient into something they can interpret, a prediction into a plot they can trust, a gap in the data into a sentence that says so plainly.

This lesson follows one fitted model through four such write-ups, in the order they usually get built.

That is the order this lesson follows, one presentation at a time.

The study, and the model fit to it

Here is the study this lesson works with. Five hundred patients had surgery, and for each one we know four things measured before the operation ended: their age, their BMI, how long the surgery took in minutes, and whether they have diabetes. The outcome is whether they went on to develop a surgical-site infection, a wound infection at the site of the operation.

These four predictors were decided before any data existed, from clinical knowledge of what raises infection risk, rather than by searching through the data for whatever happened to correlate.

One more real-world wrinkle: 17 of the 500 patients are missing a BMI measurement, so the model below is fit on the remaining 483 complete cases. Let's simulate this study and fit the model.

RInteractive R
# Simulate 500 surgical patients and fit a model predicting infection set.seed(42) n <- 500 age <- pmin(pmax(rnorm(n, 55, 13), 20), 88) bmi <- pmin(pmax(rnorm(n, 28, 5), 16), 48) duration <- pmin(pmax(rnorm(n, 120, 40), 35), 300) diabetes <- rbinom(n, 1, 0.15) linear_predictor <- -2.3 + 0.035 * (age - 55) + 0.06 * (bmi - 28) + 0.009 * (duration - 120) + 0.5 * diabetes infection <- rbinom(n, 1, plogis(linear_predictor)) # 17 patients are missing a BMI measurement, so 483 complete cases remain missing_rows <- sample(seq_len(n), 17) bmi[missing_rows] <- NA patients <- data.frame(age, bmi, duration, diabetes, infection) fit <- glm(infection ~ age + bmi + duration + diabetes, data = patients, family = binomial) summary(fit) #> #> Call: #> glm(formula = infection ~ age + bmi + duration + diabetes, family = binomial, #> data = patients) #> #> Coefficients: #> Estimate Std. Error z value Pr(>|z|) #> (Intercept) -8.061768 1.231235 -6.548 5.84e-11 *** #> age 0.047094 0.011482 4.102 4.10e-05 *** #> bmi 0.086372 0.028074 3.077 0.00209 ** #> duration 0.007810 0.003627 2.154 0.03127 * #> diabetes 0.456229 0.338891 1.346 0.17822 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> (Dispersion parameter for binomial family taken to be 1) #> #> Null deviance: 385.27 on 482 degrees of freedom #> Residual deviance: 351.32 on 478 degrees of freedom #> (17 observations deleted due to missingness) #> AIC: 361.32 #> #> Number of Fisher Scoring iterations: 5

  

Look at the Estimate column. Those numbers are correct, and this printout is the model's first presentation, the one summary() hands back by default. But hand this table to a reviewer, or to a surgeon deciding whether to trust it, and neither one can use it as it stands.

The reason is the scale those estimates live on. Each one is a change in the log odds of infection per unit of its predictor: age's estimate, 0.047094, means one more year of age adds 0.047094 to the log odds of infection. Log odds are not a scale anyone thinks in day to day, so a number like 0.047094 carries no felt sense of how much riskier an extra year of age actually makes a patient.