| surv_pred_info {shinyCox} | R Documentation |
Obtains information for standard errors of predictions
Description
Computes necessary information to calculate standard errors and
confidence intervals in shiny app. This is adapted from parts of
survfit.coxph(). This function is meant to be used in conjunction with
predict_se().
Usage
surv_pred_info(model, ctype, individual = FALSE, id, se.fit = TRUE, stype = 2)
Arguments
model |
a |
ctype |
whether the cumulative hazard computation should have a correction for ties, 1=no, 2=yes. |
individual |
deprecated argument, replaced by |
id |
optional variable name of subject identifiers. Not supported in app |
se.fit |
a logical value indicating whether standard errors should be computed. Default is TRUE for standard models, FALSE for multi-state (code not yet present for that case.) |
stype |
computation of the survival curve, 1=direct, 2=exponential of the cumulative hazard. Default is 2. |
Value
A list of information needed for computing predicted standard errors.
Examples
library(survival)
colondeaths <- colon[colon$etype == 2, ]
split_colon <- split(colondeaths, colondeaths$rx)
colon_arm1 <- split_colon$Obs
colon1ph <- coxph(Surv(time, status) ~ factor(extent) + nodes + strata(surg)
+ factor(differ),
colon_arm1,
x = TRUE, model = TRUE)
surv_pred_info(colon1ph)