Return infinitesimal jackknife residuals from a survfit object, for the survival, cumulative hazard, or restricted mean time in state (RMTS).
1 2 3 4
a vector of times at which the residuals are desired
the type of residual, see below
add the residuals for all subjects in a cluster
weight the residuals by each observation's weight
controls a choice of algorithm. Current an internal debugging option.
arguments for other methods
This function is designed to efficiently compute the leverage residuals at a
small number of time points; a primary use is the creation of
If the residuals at all time points are needed, e.g. to compute a robust
pointwise confidence interval for the survival curve, then this can be done
influence argument of the underlying
function. But be aware that such matrices can get very large.
The residuals are the impact of each observation or cluster on the
resulting probability in state curves at the given time points,
the cumulative hazard curv
surv at those time points,
or the expected sojourn time in each state up to the given time points.
For a simple Kaplan-Meier the
survfit object contains only the
probability in the "initial" state, i.e., the survival fraction.
For the KM case the sojourn time, the expected amount of time spent in
the initial state, up to the specified endpoint, is more commonly known as the
restricted mean survival time (RMST).
For a multistate model this same quantity is also referred to as the
restricted mean time in state (RMTS).
It can be computed as the area under the respective probability in state curve.
The program allows any of
for the type argument, ignoring upper/lowercase, so
users can choose whichever abbreviation they like best.
collapse=TRUE the result has the cluster identifier (which
defaults to the
id variable) as the dimname for the first dimension.
fit object contains more than one curve, and the same
identifier is reused in two different curves this approach does not work
and the routine will stop with an error.
In principle this is not necessary, e.g., the result could contain two rows
with the same label, showing the separate effect on each curve,
but this was deemed too confusing.
A matrix or array with one row per observation or cluster, and one column
for each value in
times. For a multi-state model the three
dimensions are observation, time and state. For cumulative hazard,
the last dimension is the set of transitions. (A competing risks
model for instance has 3 states and 2 transitions.)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.