# generate example data
simdata = simulate_prclmm_data(n = 20, p = 10, p.relev = 4,
t.values = c(0, 0.5, 1, 2), landmark = 2,
seed = 19931101)
# view the longitudinal markers:
if(requireNamespace("ptmixed")) {
ptmixed::make.spaghetti(x = age, y = marker1,
id = id, group = id,
data = simdata$long.data,
legend.inset = - 1)
}
# proportion of censored subjects
simdata$censoring.prop
# visualize KM estimate of survival
library(survival)
surv.obj = Surv(time = simdata$surv.data$time,
event = simdata$surv.data$event)
kaplan <- survfit(surv.obj ~ 1,
type="kaplan-meier")
plot(kaplan)
Run the code above in your browser using DataLab