coxph

0th

Percentile

Fit Proportional Hazards Regression Model

Fits a Cox proportional hazards regression model. Time dependent variables, time dependent strata, multiple events per subject, and other extensions are incorporated using the counting process formulation of Andersen and Gill.

Keywords
survival
Usage
coxph(formula, data=parent.frame(), weights, subset,
na.action, init, control, method=c("efron","breslow","exact"),
singular.ok=TRUE, robust=FALSE,
model=FALSE, x=FALSE, y=TRUE,...
)
Arguments
formula
a formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function.
data
a data.frame in which to interpret the variables named in the formula, or in the subset and the weights argument.
subset
expression saying that only a subset of the rows of the data should be used in the fit.
na.action

SPECIAL TERMS

There are two special terms that may be used in the model equation. A 'strata' term identifies a stratified Cox model; separate baseline hazard functions are fit for each strata. The cluster term is used to compute a robust variance for the model. The term + cluster(id), where id == unique(id), is equivalent to specifying the robust=T argument, and produces an approximate jackknife estimate of the variance. If the id variable were not unique, but instead identifies clusters of correlated observations, then the variance estimate is based on a grouped jackknife.

CONVERGENCE

In certain data cases the actual MLE estimate of a coefficient is infinity, e.g., a dichotomous variable where one of the groups has no events. When this happens the associated coefficient grows at a steady pace and a race condition will exist in the fitting routine: either the log likelihood converges, the information matrix becomes effectively singular, an argument to exp becomes too large for the computer hardware, or the maximum number of interactions is exceeded. The routine attempts to detect when this has happened, not always successfully.

PENALISED REGRESSION

coxph can now maximise a penalised partial likelihood with arbitrary user-defined penalty. Supplied penalty functions include ridge regression (ridge), smoothing splines (pspline), and frailty models (frailty).

References

P. Andersen and R. Gill. "Cox's regression model for counting processes, a large sample study", Annals of Statistics, 10:1100-1120, 1982.

T. Therneau, P. Grambsch, and T. Fleming. "Martingale based residuals for survival models", Biometrika, March 1990.

cluster, survfit, Surv, strata,ridge, pspline,frailty.

Aliases
• coxph
• print.coxph.null
• print.coxph.penal
• model.frame.coxph
• coxph.penalty
• [.coxph.penalty
• coxph.getdata
• summary.coxph.penal
Examples
# Create the simplest test data set
#
test1 <- list(time=  c(4, 3,1,1,2,2,3),
status=c(1,NA,1,0,1,1,0),
x=     c(0, 2,1,1,1,0,0),
sex=   c(0, 0,0,0,1,1,1))
coxph( Surv(time, status) ~ x + strata(sex), test1)  #stratified model

#
# Create a simple data set for a time-dependent model
#
test2 <- list(start=c(1, 2, 5, 2, 1, 7, 3, 4, 8, 8),
stop =c(2, 3, 6, 7, 8, 9, 9, 9,14,17),
event=c(1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
x    =c(1, 0, 0, 1, 0, 1, 1, 1, 0, 0) )

summary( coxph( Surv(start, stop, event) ~ x, test2))
Documentation reproduced from package survival, version 2.9-6, License: GPL2

Community examples

Looks like there are no examples yet.