Fit a Penalized Factor Variable

DESCRIPTION:

Fit a penalized factor variable in a survival model; random effects or frailties are one instance of this.

USAGE:

frailty(x, distribution="gamma", ...) 

REQUIRED ARGUMENTS:

x
a variable describing discrete groups.

OPTIONAL ARGUMENTS:

distribution
character string specifying the distribution of the random effect. Currently, the legal values are "gamma", "gaussian", and "t".
...
other arguments to the specific frailty function.

VALUE:

a variable with attached attributes, so as to be recognized as a penalized term by coxph or survReg.

DETAILS:

this routine calls frailty.gamma, frailty.gaussian, or frailty.t to do the actual work.

NOTE:

When using frailty terms with a survReg model, only method="aic" should be used. The method argument can be set in the call to frailty in the formula. The method argument will be passed down to the specific frailty function via the ... argument.

SEE ALSO:

, , , , .

EXAMPLES:

coxph(Surv(time, status) ~ age + sex + frailty(inst), data=lung, 
     na.action=na.exclude)