jm.resid.plot: Cox-Snell residual plot for the event process of the joint...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/JMresiduals.R

Description

Returns Cox-Snell residual plot.

Usage

1
jm.resid.plot(bayes.fit, summary = "posterior.mean", col = NULL)

Arguments

bayes.fit

a list of jmreg.aft fits.

summary

"posterior.mean" or "posterior.median" of the Cox-Snell residuals are used (default is "posterior.mean").

col

(optional) line colors for multiple fits (see "Color Specification" in par)

Details

In MCMC simulations, log(survival probabilities) are monitored to obtain posterior means/medians of the Cox-Snell residuals.

Value

Returns Cox-Snell residual plot. The plot should be roughly a straight line with unit slope when the survival model is adequate. For a list of multiple fits, the plots are superimposed on the same graph to facilitate comparison.

Author(s)

Shahedul Khan <khan@math.usask.ca>

See Also

jmreg.aft, jm.resid, jm.summary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  library(JM)
  data(aids.id)
  data(aids)
  surv.fit<-coxph(Surv(Time,death)~drug+gender+prevOI+AZT,
          data=aids.id,x=TRUE)
  lme.fit<-lme(CD4~obstime+obstime:drug+gender+prevOI+AZT,
         random=~obstime|patient,data=aids)
  jmfit.ew<-jmreg.aft(surv.fit=surv.fit,lme.fit=lme.fit,
         surv.model="eweibull",rand.model="simple",timevar="obstime",
         n.chain=2,n.adapt = 5000, n.burn = 15000, 
         n.iter = 150000, n.thin = 5)
  jmfit.ln<-jmreg.aft(surv.fit=surv.fit,lme.fit=lme.fit,
         surv.model="lnormal",rand.model="simple",timevar="obstime",
         n.chain=2,n.adapt = 5000, n.burn = 15000, 
         n.iter = 150000, n.thin = 5)
  par(mfrow=c(1,2))
  jm.resid.plot(list(jmfit.ew))
  jm.resid.plot(list(jmfit.ln))
  jm.resid.plot(list(jmfit.ew,jmfit.ln))

sa4khan/AFTjmr documentation built on March 12, 2020, 1:24 a.m.