This function is designed to remove any longitudinal information recorded
after the survival time for each individual. If the survival event is not
terminal, it is possible that longitudinal information is available in the
data after the survival time, but it should not contribute to the joint
analysis. This function takes and returns a
a jointdata object (see
a character string denoting name of the variable holding the longitudinal outcome of interest.
a character string denoting the name of the variable holding the survival time for the event of interest.
a character string denoting the name of the variable holding the id variable for the data.
a character string denoting the name of the variable holding the longitudinal time variable.
This function removes any longitudinal information recorded for an
individual after their survival time. A joint data object should have the
id column as the first column in each of the
baseline datasets. In the
dataset the second column should be the survival time and the third should
be the censoring variable. In the
longitudinal dataset, the second
column should be longitudinal outcome, the third the longitudinal time
variable and the remaining columns any other time varying covariates. The
baseline dataset should have columns 2 and onwards containing time
stationary covariates such as treatment group assignment or study
This function does not need to be run on the results of the multi-study
data simulation function
simjointmeta, because the
longitudinal data simulated under this function is already capped at the
individual's survival time.
a jointdata object, see
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
## 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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.