# NOT RUN {
# generate example data
simdata = simulate_prcmlpmm_data(n = 40, p = 6,
p.relev = 3, n.items = c(3,4,2,5,4,2),
type = 'u+b', seed = 1)
# names of the longitudinal outcomes:
names(simdata$long.data)
# markerx_y is the y-th item for latent process (LP) x
# we have 6 latent processes of interest, and for LP1
# we measure 3 items, for LP2 4, for LP3 2 items, and so on
# visualize trajectories of marker1_1
library(ptmixed)
make.spaghetti(x = age, y = marker1_1,
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