predict_se {shinyCox} | R Documentation |
Creates predicted survival and standard errors for confidence intervals
Description
Adapted from parts of survfit.coxph()
, computes predictions for
standard errors based on surv_pred_info()
output and newdata
from the
shiny app.
Usage
predict_se(listsurv, coxfit, newdata)
Arguments
listsurv |
Output from |
coxfit |
|
newdata |
Data used to make predicted standard errors |
Value
a list of number of subjects for each curve, times at which the curve has a step, number at risk for each time, number of events at each time, number censored at each time (no event but exit risk set), estimated survival, cumulative hazard at each transition, and standard error of the cumulative hazard.
Examples
library(survival)
library(shinyCox)
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)
new.data = cbind.data.frame(`factor(extent)` = 3, `surg` =
"surg=0",`factor(differ)` = 2,`nodes` = 5)
coxfit = prep_coxfit(colon1ph)
coxlist = surv_pred_info(colon1ph)
predict_se(coxlist, coxfit, new.data)
[Package shinyCox version 1.1.0 Index]