Here, we show the R code for Fig 12.1
# Main effects for 8 predictors full <- lrm(DAY30~AGE+KILLIP+HIG+DIA+HYP+HRT+TTR+SEX,data=gustos) # Interactions with age fullint <- lrm(DAY30~AGE* (KILLIP+HIG+DIA+HYP+HRT+TTR+SEX),data=gustos) # Examine contribution to fit of interactions anova(fullint) # Select only interaction AGE * HRT fullints <- lrm(DAY30~AGE*HRT+KILLIP+HIG+DIA+HYP+TTR+SEX,data=gustos) fullints Coef S.E. Wald Z P AGE 0.07587 0.024 3.16 0.0016 HRT=Tachycardia -3.6376 2.835 -1.28 0.1995 AGE * HRT=Tachycardia 0.06553 0.040 1.64 0.1004 ... # plot interaction effect: plot(fullint, AGE=NA, HRT=c("No tachycardia", "Tachycardia"))