Description Usage Arguments Details Value Author(s) See Also Examples
Returns Cox-Snell residual plot.
1 | jm.resid.plot(bayes.fit, summary = "posterior.mean", col = NULL)
|
bayes.fit |
a |
summary |
|
col |
(optional) line colors for multiple fits (see "Color Specification" in |
In MCMC simulations, log(survival probabilities) are monitored to obtain posterior means/medians of the Cox-Snell residuals.
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.
Shahedul Khan <khan@math.usask.ca>
jmreg.aft
, jm.resid
, jm.summary
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.