# Load built-in infertility dataset
infert1 <- datasets::infert
infert$case <- factor(infert$case, levels = c(0,1), labels = c("Control","Infertile"))
infert$induced <- factor(infert$induced, levels = c(0,1), labels = c("No","Yes"))
infert$spontaneous <- factor(infert$spontaneous, levels = c(0,1), labels = c("No","Yes"))
# Plot with reference levels
plot_or(
data = infert1,
outcome = "case",
predictors = c("parity","induced","spontaneous","age"),
ref = TRUE
)
# Plot without reference levels
plot_or(
data = infert1,
outcome = "case",
predictors = c("parity","induced","spontaneous","age"),
ref = FALSE
)
Run the code above in your browser using DataLab