predict.parfm: Predictions of frailty values for Parametric Frailty Models

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

View source: R/predict.parfm.R

Description

The function predict.parfm() computes predictions of frailty values for objects of class parfm.

Usage

1
2
## S3 method for class 'parfm'
predict(object, ...)

Arguments

object

A parametric frailty model, object of class parfm.

...

see predict()

Value

An object of class predict.parfm.

Author(s)

Federico Rotolo [aut, cre], Marco Munda [aut], Andrea Callegaro [ctb]

References

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 10.18637/jss.v051.i11

See Also

parfm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)

parfm documentation built on May 31, 2017, 2:48 a.m.

Search within the parfm package
Search all R packages, documentation and source code