# Example from Hosmer et al., 2013
# Applied Logistic Regression (3rd ed.), Chapter 2
# Fit logistic regression model with selected predictors, Table 2.3
mod2.3 <- glm(
fracture ~ age + priorfrac + raterisk,
family = binomial,
data = glow500
)
# Create a new data point for prediction
new.x <- data.frame(
age = 65,
priorfrac = "Yes",
raterisk = "Same"
)
# Compute the 95% confidence interval for the predicted probability
confidence.interval(mod2.3, data = new.x, confidence.level = 0.95)
Run the code above in your browser using DataLab