Learn R Programming

survival (version 2.11-4)

survreg.distributions: Parametric Survival Distributions

Description

List of distributions for accelerated failure models. These are location-scale families for some transformation of time. The entry describes the cdf $F$ and density $f$ of a canonical member of the family.

Usage

survreg.distributions

Arguments

format

There are three basic formats; only the first two are used in the built-in distributions ll{ name: name of distribution variance: Variance init(x,weights,...): Function returning an initial mean and variance deviance(y,scale,parms): Function returning the deviance density(x,parms): Function returning $F$, $1-F$,$f$,$f'/f$,$f''/f$ quantile(p,parms): Quantile function scale: Optional fixed value for scale parameter } and for transformations of the time variable ll{ name: name of distribution dist: name of transformed distribution trans: transformation (eg log) dtrans: derivative of transformation itrans: inverse of transformation scale: Optional fixed value for scale parameter } For transformations of user-defined families use ll{ name: name of distribution dist: transformed distribution in first format trans: transformation (eg log) dtrans: derivative of transformation itrans: inverse of transformation scale: Optional fixed value for scale parameter }

Details

There are four basic distributions:extreme, gaussian, logistic and t. The last three are parametrised in the same way as the distributions already present in R. The extreme value cdf is $$F=1-e^{-e^t}.$$

When the logarithm of survival time has one of the first three distributions we obtain respectively lognormal,loglogistic and weibull.

The other predefined distributions are defined in terms of these. The exponential and rayleigh distributions are Weibull distributions with fixed scale of 1 and 0.5 respectively, and loggaussian is a synonym for lognormal.

Parts of the built-in distributions are hardcoded in C, so the elements of survreg.distributions in the first format above must not be changed and new ones must not be added. The examples show how to specify user-defined distributions to survreg.

See Also

survreg, pnorm,plogis, pt

Examples

Run this code
data(ovarian)
## not a good fit, but a useful example
survreg(Surv(futime,fustat)~ecog.ps+rx,data=ovarian,dist='extreme')
## 
my.extreme<-survreg.distributions$extreme
my.extreme$name<-"Xtreme"
survreg(Surv(futime,fustat)~ecog.ps+rx,data=ovarian,dist=my.extreme)

## time transformation
survreg(Surv(futime,fustat)~ecog.ps+rx,data=ovarian,dist='weibull',scale=1)
my.weibull<-survreg.distributions$weibull
my.weibull$dist<-my.extreme
survreg(Surv(futime,fustat)~ecog.ps+rx,data=ovarian,dist=my.weibull,scale=1)

## change the transformation to work in years
## intercept changes by log(365), other coefficients stay the same
my.weibull$trans<-function(y) log(y/365)
my.weibull$itrans<-function(y) exp(365*y)
survreg(Surv(futime,fustat)~ecog.ps+rx,data=ovarian,dist=my.weibull,scale=1)

Run the code above in your browser using DataLab