# [R] Re: Frailty and coxph

Göran Broström gb at stat.umu.se
Tue Oct 8 17:52:49 CEST 2002

```On Tue, 8 Oct 2002, Göran Broström wrote:

>
> Does someone know the rules by which 'coxph' returns 'frail', the
> predicted frailty terms? In my test function:

[...]

Expanding my example function:

-------------------------------------------------------------
fr <- function(lup){
#testing(frailty terms in 'survival'
require(survival)

lupp <- 2 * lup

dat <- data.frame(exit = 1:lupp,
event = rep(1, lupp),
x = rep(c(0, 1), lup),
family = sample(rep(1:lup, 2))
)
fit1 <- coxph(Surv(exit, event) ~ x +
frailty(family, dist = "gaussian"), data = dat)

return(fit1\$frail)
-------------------------------------------------------------

> fr(5)
NULL
> fr(6)
[1]  0.04036113  0.17815670  0.02927139 -0.12160991  0.13439779
-0.26057710

'lup' larger than 5 (only) returns predicted frailty terms.

Göran

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```