jm.resid: Cox-Snell residuals for the event process of the joint model

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

View source: R/JMresiduals.R

Description

Returns Cox-Snell residuals.

Usage

1
jm.resid(bayes.fit, posterior.mean = TRUE)

Arguments

bayes.fit

a fit of the joint model using jmreg.aft.

posterior.mean

returns posterior means if TRUE, and posterior medians if FALSE.

Details

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

Value

Returns posterior means/medians of the Cox-Snell residuals.

Author(s)

Shahedul Khan <khan@math.usask.ca>

See Also

jmreg.aft, jm.resid.plot, jm.summary,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  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)
# exponentiated weibull time-to-event process
  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)
jm.resid(jmfit.ew)

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