# Example from Hosmer et al., 2013
# Applied Logistic Regression (3rd ed.), Chapter 7, Table 7.1
# Convert 'fracture' to binary (0 = No, 1 = Yes)
glow11m$fracture <- ifelse(glow11m$fracture == "Yes", 1, 0)
# Define variables to evaluate
unvariables <- c(
"height", "weight", "bmi", "priorfrac", "premeno", "momfrac",
"armassist", "smoke", "raterisk")
# Define value ranges used to interpret odds ratios (Optional)
val.pe <- c(10, 10, 3, 1, 1, 1, 1, 1, 1, 1)
# Run univariable conditional logistic regressions
univariable.clogmodels(glow11m, yval = 'fracture', xval = unvariables,
strata = 'pair', OR = TRUE, inc.or = val.pe)
Run the code above in your browser using DataLab