Title: | Joint Longitudinal and Survival Model for Big Data |
---|---|
Description: | Provides analysis tools for big data where the sample size is very large. It offers a suite of functions for fitting and predicting joint models, which allow for the simultaneous analysis of longitudinal and time-to-event data. This statistical methodology is particularly useful in medical research where there is often interest in understanding the relationship between a longitudinal biomarker and a clinical outcome, such as survival or disease progression. This can be particularly useful in a clinical setting where it is important to be able to predict how a patient's health status may change over time. Overall, this package provides a comprehensive set of tools for joint modeling of BIG data obtained as survival and longitudinal outcomes with both Bayesian and non-Bayesian approaches. Its versatility and flexibility make it a valuable resource for researchers in many different fields, particularly in the medical and health sciences. |
Authors: | Atanu Bhattacharjee [aut, cre, ctb], Bhrigu Kumar Rajbongshi [aut, ctb], Gajendra K Vishwakarma [aut, ctb] |
Maintainer: | Atanu Bhattacharjee <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2024-11-16 05:38:16 UTC |
Source: | https://github.com/cran/jmBIG |
FastJM
Bootstrapped CI for predicted survival probability
cisurvfitJMCS(object)
cisurvfitJMCS(object)
object |
a |
Bootstrap CI for the survival probability and other relevant information for predicted survival plot
## library(survival) library(dplyr) jmcs1<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') mod2<-jmcs1 P2<-survfitJMCS(model<-mod2,ids<-c(5),u<-seq(surv2[surv2$id==5,]$time, surv2[surv2$id==5,]$time+10,0.2),obs.time='time') bootci<-cisurvfitJMCS(P2) print(bootci) ##
## library(survival) library(dplyr) jmcs1<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') mod2<-jmcs1 P2<-survfitJMCS(model<-mod2,ids<-c(5),u<-seq(surv2[surv2$id==5,]$time, surv2[surv2$id==5,]$time+10,0.2),obs.time='time') bootci<-cisurvfitJMCS(P2) print(bootci) ##
function for joint model in BIG DATA using JMbayes2
jmbayesBig( dtlong, dtsurv, longm, survm, samplesize = 50, rd, timeVar, nchain = 1, id, niter = 2000, nburnin = 1000 )
jmbayesBig( dtlong, dtsurv, longm, survm, samplesize = 50, rd, timeVar, nchain = 1, id, niter = 2000, nburnin = 1000 )
dtlong |
longitudinal dataset, which contains id,visit time,longitudinal measurements along with various covariates |
dtsurv |
survival dataset corresponding to the longitudinal dataset, with survival status and survival time |
longm |
fixed effect model for longitudinal response |
survm |
survival model |
samplesize |
sample size to divide the Big data |
rd |
random effect model part |
timeVar |
time variable in longitudinal model, included in the longitudinal data |
nchain |
number of chain for MCMC |
id |
name of id column in longitudinal dataset |
niter |
number of iteration for MCMC chain |
nburnin |
number of burnin sample for MCMC chain |
returns a list containing various output which are useful for prediction.
Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra Kumar Vishwakarma
Rizopoulos, D., G. Papageorgiou, and P. Miranda Afonso. "JMbayes2: extended joint models for longitudinal and time-to-event data." R package version 0.2-4 (2022).
## library(survival) library(nlme) library(dplyr) fit5<-jmbayesBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd= ~ visit|id,timeVar='visit',nchain=1,samplesize=200,id='id') ydt<-long2%>%filter(id%in%c(900)) cdt<-surv2[,'id']%>%filter(id%in%c(900)) newdata<-full_join(ydt,cdt,by='id') P2<-predJMbayes(model<-fit5,ids<-c(900),newdata=newdata,process = 'event') plot(P2$p1[[1]]) ##
## library(survival) library(nlme) library(dplyr) fit5<-jmbayesBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd= ~ visit|id,timeVar='visit',nchain=1,samplesize=200,id='id') ydt<-long2%>%filter(id%in%c(900)) cdt<-surv2[,'id']%>%filter(id%in%c(900)) newdata<-full_join(ydt,cdt,by='id') P2<-predJMbayes(model<-fit5,ids<-c(900),newdata=newdata,process = 'event') plot(P2$p1[[1]]) ##
function for joint model in BIG DATA using FastJM
jmcsBig(dtlong, dtsurv, longm, survm, samplesize = 50, rd, id)
jmcsBig(dtlong, dtsurv, longm, survm, samplesize = 50, rd, id)
dtlong |
longitudinal dataset, which contains id,visit time,longitudinal measurements along with various covariates |
dtsurv |
survival dataset corresponding to the longitudinal dataset, with survival status and survival time |
longm |
model for longitudinal response |
survm |
survival model |
samplesize |
sample size to divide the Big data |
rd |
random effect part |
id |
name of id column in longitudinal dataset |
returns a list containing various output which are useful for prediction.
Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra Kumar Vishwakarma
Li, Shanpeng, et al. "Efficient Algorithms and Implementation of a Semiparametric Joint Model for Longitudinal and Competing Risk Data: With Applications to Massive Biobank Data." Computational and Mathematical Methods in Medicine 2022 (2022).
jmbayesBig,jmstanBig,joinRMLBig
## library(survival) library(dplyr) fit2<-jmcsBig(dtlong=data.frame(long2),dtsurv = data.frame(surv2), longm=y~ x7+visit,survm=Surv(time,status)~x1+visit,rd= ~ visit|id,samplesize=200,id='id') print(fit2) ##
## library(survival) library(dplyr) fit2<-jmcsBig(dtlong=data.frame(long2),dtsurv = data.frame(surv2), longm=y~ x7+visit,survm=Surv(time,status)~x1+visit,rd= ~ visit|id,samplesize=200,id='id') print(fit2) ##
function for joint model in BIG DATA using rstanarm
package
jmstanBig( dtlong, dtsurv, longm, survm, samplesize = 50, time_var, id, nchain = 1, refresh = 2000 )
jmstanBig( dtlong, dtsurv, longm, survm, samplesize = 50, time_var, id, nchain = 1, refresh = 2000 )
dtlong |
longitudinal dataset, which contains id,visit time,longitudinal measurements along with various covariates |
dtsurv |
survival dataset corresponding to the longitudinal dataset, with survival status and survival time |
longm |
model for longitudinal response |
survm |
survival model |
samplesize |
sample size to divide the Big data |
time_var |
time variable in longitudinal model, included in the longitudinal data |
id |
name of id column in longitudinal dataset |
nchain |
number of chain for MCMC |
refresh |
refresh rate for MCMC chain |
returns a list containing various output which are useful for prediction.
Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra Kumar Vishwakarma
Goodrich, B., et al. "rstanarm: Bayesian applied regression modeling via Stan. R package version 2.17. 4." Online< http://mc-stan. org (2018).
## library(survival) library(dplyr) fit3<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id') P2<-postTraj(model<-fit3,m<-1,ids<-c(1,2,100)) pp1<-plot(P2$p1[[1]],plot_observed = TRUE) pp2<-plot(P2$p1[[2]],plot_observed = TRUE) pp3<-plot(P2$p1[[3]],plot_observed = TRUE) ##
## library(survival) library(dplyr) fit3<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id') P2<-postTraj(model<-fit3,m<-1,ids<-c(1,2,100)) pp1<-plot(P2$p1[[1]],plot_observed = TRUE) pp2<-plot(P2$p1[[2]],plot_observed = TRUE) pp3<-plot(P2$p1[[3]],plot_observed = TRUE) ##
function for joint model in BIG DATA using joineRML
joinRMLBig(dtlong, dtsurv, longm, survm, samplesize = 50, rd, timeVar, id)
joinRMLBig(dtlong, dtsurv, longm, survm, samplesize = 50, rd, timeVar, id)
dtlong |
longitudinal dataset, which contains id,visit time,longitudinal measurements along with various covariates |
dtsurv |
survival dataset corresponding to the longitudinal dataset, with survival status and survival time |
longm |
model for longitudinal response |
survm |
survival model |
samplesize |
random effect part |
rd |
random effect part |
timeVar |
time variable in longitudinal model, included in the longitudinal data |
id |
name of id column in longitudinal dataset |
returns a list containing various output which are useful for prediction.
Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra Kumar Vishwakarma
Hickey, Graeme L., et al. "joineRML: a joint model and software package for time-to-event and multivariate longitudinal outcomes." BMC medical research methodology 18 (2018): 1-14.
## library(survival) library(dplyr) fit4<-joinRMLBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd=~ visit|id,timeVar='visit',samplesize=200,id='id') P2<-predJRML(model<-fit4,ids<-c(10),dtlong=long2,dtsurv=surv2) pp1<-plot(P2$plong[[1]]) pp1<-plot(P2$psurv[[1]]) ##
## library(survival) library(dplyr) fit4<-joinRMLBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd=~ visit|id,timeVar='visit',samplesize=200,id='id') P2<-predJRML(model<-fit4,ids<-c(10),dtlong=long2,dtsurv=surv2) pp1<-plot(P2$plong[[1]]) pp1<-plot(P2$psurv[[1]]) ##
A longitudinal dataset with single marker , with different numeric and categorical covariate
data(long2)
data(long2)
a tibble of 13 columns and 5639 observations,
id value for subjects
survival status
survival time
longitudinal marker
visit time of longitudinal measurements
different numeric and categorical variable
A longitudinal dataset with single marker , with different numeric and categorical covariate
data(longsurv)
data(longsurv)
a tibble of 13 columns and 5639 observations,
id value for subjects
survival status
survival time
longitudinal marker
visit time of longitudinal measurements
different numeric and categorical variable
cisurvfitJMCS
objectprediction of survival probability and longitudinal marker using FastJM
for BIG data
plot_cisurvfitJMCS(object)
plot_cisurvfitJMCS(object)
object |
fitted |
Plot for predicted survival probability
## library(survival) library(dplyr) jmcs1<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') mod2<-jmcs1 P2<-survfitJMCS(model<-mod2,ids<-c(5),u<-seq(surv2[surv2$id==5,]$time, surv2[surv2$id==5,]$time+10,0.2),obs.time='time') P3<-cisurvfitJMCS(P2) plot_cisurvfitJMCS(P3) ##
## library(survival) library(dplyr) jmcs1<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') mod2<-jmcs1 P2<-survfitJMCS(model<-mod2,ids<-c(5),u<-seq(surv2[surv2$id==5,]$time, surv2[surv2$id==5,]$time+10,0.2),obs.time='time') P3<-cisurvfitJMCS(P2) plot_cisurvfitJMCS(P3) ##
rstanarm
posterior survival probability estimates from rstanarm for BIG data
postSurvfit(model, ids, ...)
postSurvfit(model, ids, ...)
model |
fitted model |
ids |
value of id |
... |
other parameter option, see |
list of predicted value for the given id
## library(survival) library(dplyr) jmstan<-jmstanBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit, samplesize=200, time_var='visit',id='id') mod1<-jmstan P2<-postSurvfit(model<-mod1,ids<-c(1,2,210)) pp1<-plot(P2$p1[[1]]) pp1 pp2<-plot(P2$p1[[2]]) pp2 pp3<-plot(P2$p1[[3]]) pp3 ##
## library(survival) library(dplyr) jmstan<-jmstanBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit, samplesize=200, time_var='visit',id='id') mod1<-jmstan P2<-postSurvfit(model<-mod1,ids<-c(1,2,210)) pp1<-plot(P2$p1[[1]]) pp1 pp2<-plot(P2$p1[[2]]) pp2 pp3<-plot(P2$p1[[3]]) pp3 ##
rstanarm
prediction of the posterior trajectory for longitudinal marker while using rstanarm
for Big data
postTraj(model, m, ids, ...)
postTraj(model, m, ids, ...)
model |
fitted model object |
m |
m for |
ids |
value of id |
... |
other parameter option, see |
list of predicted values for the given id
## library(survival) library(dplyr) fit6<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id') P2<-postTraj(model<-fit6,m<-1,ids<-c(1,2,100)) pp1<-plot(P2$p1[[1]],plot_observed = TRUE) pp2<-plot(P2$p1[[2]],plot_observed = TRUE) pp3<-plot(P2$p1[[3]],plot_observed = TRUE) ##
## library(survival) library(dplyr) fit6<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id') P2<-postTraj(model<-fit6,m<-1,ids<-c(1,2,100)) pp1<-plot(P2$p1[[1]],plot_observed = TRUE) pp2<-plot(P2$p1[[2]],plot_observed = TRUE) pp3<-plot(P2$p1[[3]],plot_observed = TRUE) ##
JMbayes2
prediction of survival probability and longitudinal marker using jmBayes2
for BIG data
predJMbayes(model, ids, process = "longitudinal", newdata, ...)
predJMbayes(model, ids, process = "longitudinal", newdata, ...)
model |
fitted model object |
ids |
value of id |
process |
see |
newdata |
dataset having covariate information for the ids mentioned above. |
... |
other parameter options, see |
list of predicted value for the given id
## library(survival) library(nlme) library(dplyr) jmcs1<-jmbayesBig(dtlong=long2, dtsurv = surv2 , longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, timeVar='visit', nchain=1, samplesize=200, id='id') mod3<-jmcs1 ydt<-long2%>%filter(id%in%c(900)) names(ydt) cdt<-surv2[,'id']%>%filter(id%in%c(900)) names(cdt) newdata<-full_join(ydt,cdt,by='id') P2<-predJMbayes(model<-mod3,ids<-c(900),newdata=newdata,process = 'event') plot(P2$p1[[1]]) ##
## library(survival) library(nlme) library(dplyr) jmcs1<-jmbayesBig(dtlong=long2, dtsurv = surv2 , longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, timeVar='visit', nchain=1, samplesize=200, id='id') mod3<-jmcs1 ydt<-long2%>%filter(id%in%c(900)) names(ydt) cdt<-surv2[,'id']%>%filter(id%in%c(900)) names(cdt) newdata<-full_join(ydt,cdt,by='id') P2<-predJMbayes(model<-mod3,ids<-c(900),newdata=newdata,process = 'event') plot(P2$p1[[1]]) ##
joineRML
prediction of survival probability and longitudinal marker using joineRML
for BIG data
predJRML(model, ids, dtlong, dtsurv)
predJRML(model, ids, dtlong, dtsurv)
model |
fitted model object |
ids |
value of id |
dtlong |
longitudinal data |
dtsurv |
survival data |
list of predicted values for the given id
## library(survival) library(dplyr) jmcs1<-joinRMLBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd=~ visit|id, timeVar='visit', samplesize=200, id='id') mod4<-jmcs1 P2<-predJRML(model<-mod4,ids<-c(10),dtlong=long2,dtsurv=surv2) plot(P2$plong[[1]]) plot(P2$psurv[[1]]) ##
## library(survival) library(dplyr) jmcs1<-joinRMLBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd=~ visit|id, timeVar='visit', samplesize=200, id='id') mod4<-jmcs1 P2<-predJRML(model<-mod4,ids<-c(10),dtlong=long2,dtsurv=surv2) plot(P2$plong[[1]]) plot(P2$psurv[[1]]) ##
print(object, ...)
print(object, ...)
object |
object |
... |
others |
prints table containing various parameter estimates, SE, P- value for both survival and longitudinal submodel, if the model is bayesian it includes their credible interval too.
## library(survival) library(dplyr) fit7<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id') ################################ fit8<-jmcsBig(dtlong=data.frame(long2),dtsurv = data.frame(surv2), longm=y~ x7+visit,survm=Surv(time,status)~x1+visit,rd= ~ visit|id, samplesize=200,id='id') ################################# fit9<-jmbayesBig(dtlong=long2,dtsurv = surv2 , longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd= ~ visit|id,timeVar='visit',nchain=1,samplesize=200,id='id') ################################# fit10<-joinRMLBig(dtlong=long2,dtsurv = surv2, longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd=~ visit|id,timeVar='visit',samplesize=200,id='id')
## library(survival) library(dplyr) fit7<-jmstanBig(dtlong=long2,dtsurv = surv2,longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit,samplesize=200,time_var='visit',id='id') ################################ fit8<-jmcsBig(dtlong=data.frame(long2),dtsurv = data.frame(surv2), longm=y~ x7+visit,survm=Surv(time,status)~x1+visit,rd= ~ visit|id, samplesize=200,id='id') ################################# fit9<-jmbayesBig(dtlong=long2,dtsurv = surv2 , longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd= ~ visit|id,timeVar='visit',nchain=1,samplesize=200,id='id') ################################# fit10<-joinRMLBig(dtlong=long2,dtsurv = surv2, longm=y~ x7+visit,survm=Surv(time,status)~x1+visit, rd=~ visit|id,timeVar='visit',samplesize=200,id='id')
print method for class 'jmbayesBig'
## S3 method for class 'jmbayesBig' print(object, digits = 4, ...)
## S3 method for class 'jmbayesBig' print(object, digits = 4, ...)
object |
object |
digits |
used for round the numeric values after decimal |
... |
others |
prints table containing various parameter estimates, SE, P- value for both survival and longitudinal submodel, if the model is bayesian it includes their credible interval too.
## library(survival) library(dplyr) ################################# mod3<-jmbayesBig(dtlong=long2, dtsurv = surv2 , longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, timeVar='visit', nchain=1, samplesize=200, id='id') print(mod3)
## library(survival) library(dplyr) ################################# mod3<-jmbayesBig(dtlong=long2, dtsurv = surv2 , longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, timeVar='visit', nchain=1, samplesize=200, id='id') print(mod3)
print method for class 'jmcsBig'
## S3 method for class 'jmcsBig' print(object, digits = 3, ...)
## S3 method for class 'jmcsBig' print(object, digits = 3, ...)
object |
object |
digits |
used for round the numeric values after decimal |
... |
others |
prints table containing various parameter estimates, SE, P- value for both survival and longitudinal submodel, if the model is bayesian it includes their credible interval too.
## library(survival) library(dplyr) ################################ mod2<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') print(mod2)
## library(survival) library(dplyr) ################################ mod2<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') print(mod2)
print method for class 'jmstanBig'
## S3 method for class 'jmstanBig' print(object, digits = 3, ...)
## S3 method for class 'jmstanBig' print(object, digits = 3, ...)
object |
object |
digits |
used for round the numeric values after decimal |
... |
others |
prints table containing various parameter estimates, SE, P- value for both survival and longitudinal submodel, if the model is bayesian it includes their credible interval too.
## library(survival) library(dplyr) mod1<-jmstanBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit, samplesize=200, time_var='visit',id='id') print(mod1)
## library(survival) library(dplyr) mod1<-jmstanBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit+(1|id), survm=Surv(time,status)~x1+visit, samplesize=200, time_var='visit',id='id') print(mod1)
print method for class 'joinRMLBig'
## S3 method for class 'joinRMLBig' print(object, digits = 4, ...)
## S3 method for class 'joinRMLBig' print(object, digits = 4, ...)
object |
object |
digits |
used for round the numeric values after decimal |
... |
others |
prints table containing various parameter estimates, SE, P- value for both survival and longitudinal submodel, if the model is bayesian it includes their credible interval too.
## library(survival) library(dplyr) mod4<-joinRMLBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd=~ visit|id, timeVar='visit', samplesize=200, id='id') print(mod4)
## library(survival) library(dplyr) mod4<-joinRMLBig(dtlong=long2, dtsurv = surv2, longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd=~ visit|id, timeVar='visit', samplesize=200, id='id') print(mod4)
A survival dataset related the long2 dataset, with different numeric and categorical covariate
data(surv2)
data(surv2)
a tibble of 13 columns and 1000 observations,
id value for subjects
survival status
survival time
visit time of longitudinal measurements
different numeric and categorical variable
FastJM
prediction of survival probability using FastJM
for BIG data
survfitJMCS(model, ids, u, method = "GH", obs.time)
survfitJMCS(model, ids, u, method = "GH", obs.time)
model |
fitted model object |
ids |
value of id |
u |
see |
method |
options are 'Laplace','GH' |
obs.time |
vector which represents time variable in the longitudinal data |
list of predicted value for the given id along with other information relevant for survival probability confidence plot
## library(survival) library(dplyr) jmcs1<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') mod2<-jmcs1 P2<-survfitJMCS(model<-mod2,ids<-c(5),u<-seq(surv2[surv2$id==5,]$time, surv2[surv2$id==5,]$time+10,0.2),obs.time='time') print(P2) ##
## library(survival) library(dplyr) jmcs1<-jmcsBig(dtlong=data.frame(long2), dtsurv = data.frame(surv2), longm=y~ x7+visit, survm=Surv(time,status)~x1+visit, rd= ~ visit|id, samplesize=200,id='id') mod2<-jmcs1 P2<-survfitJMCS(model<-mod2,ids<-c(5),u<-seq(surv2[surv2$id==5,]$time, surv2[surv2$id==5,]$time+10,0.2),obs.time='time') print(P2) ##