In addition to reporting the numeric results of a logistic regression, it is helpful to create a forest plot to visualize the AORs and their 95% CIs. You can easily create a forest plot using
sjPlot::plot_model() (Lüdecke 2023). See
?plot_model for customization options.
Example 6.3 (continued): Create a forest plot displaying the AORs for the model. To put the AOR for age of first alcohol use on a similar scale as the categorical predictors, use the AOR and 95% CI for a 4-year difference in age (the interquartile range).
For the purpose of creating a forest plot, changing the age scale must be made via the method that transforms age prior to fitting the model (see Section 6.6.1). Using the interquartile range results in an AOR that compares the adjusted odds of the outcome between individuals at the 75th and 25th percentiles of the predictor distribution.
##  4
<- nsduh %>% fpdat mutate(alc_agefirst4 = alc_agefirst/4) <- glm(mj_lifetime ~ alc_agefirst4 + demog_age_cat6 + demog_sex + fit.fp family = binomial, data = fpdat) demog_income, # Use [-1,] to exclude the intercept since exp(intercept) is not an OR <- exp(confint(fit.fp))[-1,]CI
The forest plot is shown in Figure 6.3.
# Forest plot ::plot_model(fit.fp, sjPlotaxis.lim = c(min(CI), max(CI)), auto.label = F)