View source: R/predict.parfm.R
predict.parfm | R Documentation |
The function predict.parfm()
computes predictions of frailty values for objects of class parfm
.
## S3 method for class 'parfm' predict(object, ...)
object |
A parametric frailty model, object of class |
... |
see |
An object of class predict.parfm
.
Federico Rotolo [aut, cre], Marco Munda [aut], Andrea Callegaro [ctb]
Glidden D, Vittinghoff E (2004). Modelling Clustered Survival Data From Multicentre Clinical Trials. Statistics in medicine, 23(3), 369–388.
Munda M, Rotolo F, Legrand C (2012). parfm: Parametric Frailty Models in R. Journal of Statistical Software, 51(11), 1-20. DOI <doi: 10.18637/jss.v051.i11>
parfm
data(kidney) kidney$sex <- kidney$sex - 1 model <- parfm(Surv(time,status) ~ sex + age, cluster = "id", data = kidney, dist = "exponential", frailty = "gamma") u <- predict(model) u # Predictions from semi-parametric Gamma frailty model # via coxph() function model.coxph <- coxph(Surv(time,status) ~ sex + age + frailty(id, frailty = "gamma", eps = 1e-11), outer.max = 15, data = kidney) u.coxph <- exp(model.coxph$frail) # Plot of predictions from both models par(mfrow = c(1,2)) ylim <- c(0, max(c(u, u.coxph))) plot(u, sort = "i", main = paste("Parametric", "Gamma frailty model", "with Exponential baseline", sep = "\n"), ylim = ylim) names(u.coxph) <- kidney[seq(2,76, 2), "id"] class(u.coxph) <- "predict.parfm" attr(u.coxph, "clustname") <- "id" plot(u.coxph, sort = "i", main = paste("Semi-parametric", "Gamma frailty model", sep = "\n"), ylim = ylim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.