# NOT RUN {
# Load Carpenter (2002) data
data("CarpenterFdaData")
# Load survival package
library(survival)
# Run basic model
M1 <- coxph(Surv(acttime, censor) ~ lethal*prevgenx,
data = CarpenterFdaData)
# Simulate Marginal Effect of lethal for multiple
# values of prevgenx
Sim1 <- coxsimInteract(M1, b1 = "lethal", b2 = "prevgenx",
X2 = seq(2, 115, by = 5), spin = TRUE)
# Plot simulations
simGG(Sim1)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab