plot.jmrmlB: Prediction plot from 'jmrmlB()'

View source: R/plot.jmrmlB.R

plot.jmrmlBR Documentation

Prediction plot from jmrmlB()

Description

Prediction plot from jmrmlB()

Usage

## S3 method for class 'jmrmlB'
plot(x, y, ...)

Arguments

x

fitted model object

y

newdata

...

others

Value

Returns prediction plot for the newdata using the model fitted through jmrmlB().

Note

In the example code we use newdata as the data for ID 2 in the PBC2 dataset, it has follow up information till 8.832. Now suppose we want to look at the survival of ID 2 under joint model 1 after time 4 and for joint model 2 after time 9. For that we created the newdata as if the individual is followed till for a time period less than min(4,9).

Examples

 
##
library(JMbayes2)
library(joineRML)
jmrmlBModel<-jmrmlB(dtlong=new_long2[new_long2$id<=400,],
                    dtsurv=new_surv2[new_surv2$id<=400,],
                    longm=list(y~x7+visit,y~x7+visit),
                    survm=list(Surv(time,status)~x1+visit,
                               Surv(time_2,status_2)~x1+visit),
                    rd=list(~visit|id,~visit|id),
                    id='id',
                    timeVar='visit',
                    samplesize=200,
                    BIGdata=TRUE)
t0<-6
ndBIG<-new_long2[new_long2$id==10,]
ndBIG<-ndBIG[ndBIG$visit<t0,]
ndBIG$status<-0
ndBIG$time<-t0
ndBIG$time_2<-10
ndBIG$status_2<-0
plot(jmrmlBModel,ndBIG)
##


JMbdirect documentation built on April 12, 2025, 1:55 a.m.