# Example from Hosmer et al., 2013
# Applied Logistic Regression (3rd ed.), Chapter 7
# Convert 'fracture' to binary (0 = No, 1 = Yes)
glow11m$fracture <- ifelse(glow11m$fracture == "Yes", 1, 0)
# Load required package
library(survival)
# Fit a conditional logistic regression model
mod7.3 <- clogit(
fracture ~ weight + bmi + priorfrac + momfrac + armassist + strata(pair),
data = glow11m)
# Run diagnostics for the conditional logistic model
residuals_clog(mod7.3, strata = glow11m$pair, y = glow11m$fracture)
Run the code above in your browser using DataLab