# Example from Hosmer et al., 2013
# Applied Logistic Regression (3rd ed.), Chapter 5, Table 5.18
# Recode 'raterisk' into a binary categorical variable 'raterisk_cat'
glow500<-dplyr::mutate(
glow500,
raterisk_cat = dplyr::case_when(
raterisk %in% c('Less', 'Same') ~ 'C1',
raterisk == 'Greater' ~ 'C2'))
model.int <- glm(
fracture ~ age + height + priorfrac + momfrac +
armassist + raterisk_cat + age*priorfrac + momfrac*armassist,
family = binomial, data = glow500)
# Specify variables and interpretation units for OR computation
var.or<-c('raterisk_catC2','height')
units.var<-c('raterisk_catC2'=1,'height'=5)
# Calculate and interpret adjusted odds ratios
coeff.OR(model.int,variable = var.or, c = units.var)
Run the code above in your browser using DataLab