# NOT RUN {
# }
# NOT RUN {
#the dataset simdat3 in this package contains joint data where longitudinal
#data exists after individual's survival times.
str(simdat3)
#first this data needs to be changed to a jointdata object
jointdat3<-tojointdata(longitudinal = simdat3$longitudinal,
survival = simdat3$survival, id = 'id', longoutcome = 'Y',
timevarying = c('time','ltime'), survtime = 'survtime',
cens = 'cens',time = 'time')
#then additional data recorded after the survival time can be removed
jointdat3.1<-removeafter(data = jointdat3, longitudinal = 'Y',
survival = 'survtime', id = 'id', time = 'time')
#we can compare the two datasets to see the removed data
str(jointdat3)
str(jointdat3.1)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab