Usage
survfitcoxph.fit(y, x, wt, x2, risk, newrisk, strata, se.fit, survtype,
vartype, varmat, id, y2, strata2, unlist=TRUE)
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=Kalbfleish-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<
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.