coxsurv.fit | R Documentation |
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.
coxsurv.fit(ctype, stype, se.fit, varmat, cluster,
y, x, wt, risk, position, strata, oldid,
y2, x2, risk2, strata2, id2, unlist=TRUE)
stype |
survival curve computation: 1=direct, 2=exp(-cumulative hazard) |
ctype |
cumulative hazard computation: 1=Breslow, 2=Efron |
se.fit |
if TRUE, compute standard errors |
varmat |
the variance matrix of the coefficients |
cluster |
vector to control robust variance |
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. |
risk |
the risk score exp(X beta + offset) from the fitted Cox model. |
position |
optional argument controlling what is counted as 'censored'. Due to time dependent covariates, for instance, a subject might have start, stop times of (1,5)(5,30)(30,100). Times 5 and 30 are not 'real' censorings. Position is 1 for a real start, 2 for an actual end, 3 for both, 0 for neither. |
strata |
strata variable used in the Cox model. This will be a factor. |
oldid |
identifier for subjects with multiple rows in the original data. |
y2 , x2 , risk2 , strata2 |
variables for the hypothetical subjects, for which prediction is desired |
id2 |
optional; if present and not NULL this should be
a vector of identifiers of length |
unlist |
if |
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.
The source code for for both this function and
survfit.coxph
is written using noweb. For complete
documentation see the inst/sourcecode.pdf
file.
Terry Therneau
survfit.coxph
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.