Learn R Programming

survival (version 3.5-3)

survfitcoxph.fit: A direct interface to the `computational engine' of survfit.coxph

Description

This program is mainly supplied to allow other packages to invoke the survfit.coxph function at a `data' level rather than a `user' level. It does no checks on the input data that is provided, which can lead to unexpected errors if that data is wrong.

Usage

survfitcoxph.fit(y, x, wt, x2, risk, newrisk, strata, se.fit, survtype,
vartype, varmat, id, y2, strata2, unlist=TRUE)

Value

a list containing nearly all the components of a survfit

object. All that is missing is to add the confidence intervals, the type of the original model's response (as in a coxph object), and the class.

Arguments

y

the response variable used in the Cox model. (Missing values removed of course.)

x

covariate matrix used in the Cox model

wt

weight vector for the Cox model. If the model was unweighted use a vector of 1s.

x2

matrix describing the hypothetical subjects for which a curve is desired. Must have the same number of columns as x.

risk

the risk score exp(X beta) from the fitted Cox model. If the model had an offset, include it in the argument to exp.

newrisk

risk scores for the hypothetical subjects

strata

strata variable used in the Cox model. This will be a factor.

se.fit

if TRUE the standard errors of the curve(s) are returned

survtype

1=Kalbfleisch-Prentice, 2=Nelson-Aalen, 3=Efron. It is usual to match this to the approximation for ties used in the coxph model: KP for `exact', N-A for `breslow' and Efron for `efron'.

vartype

1=Greenwood, 2=Aalen, 3=Efron

varmat

the variance matrix of the coefficients

id

optional; if present and not NULL this should be a vector of identifiers of length nrow(x2). A mon-null value signifies that x2 contains time dependent covariates, in which case this identifies which rows of x2 go with each subject.

y2

survival times, for time dependent prediction. It gives the time range (time1,time2] for each row of x2. Note: this must be a Surv object and thus contains a status indicator, which is never used in the routine, however.

strata2

vector of strata indicators for x2. This must be a factor.

unlist

if FALSE the result will be a list with one element for each strata. Otherwise the strata are ``unpacked'' into the form found in a survfit object.

Author

Terry Therneau

See Also

survfit.coxph