survDiff
returns estimated survival function or cumulative function
from posterior estimates. Note that currently, the function is only
applicable to the Bayesian dynamic Cox model with dynamic hazard, where the
control argument is specified to be control = list(intercept = TRUE)
in function bayesCox
.
survDiff(object, newdata, type = c("survival", "cumhaz"), level = 0.95, ...)
A data frame with column: "Low", "Mid", "High", "Time", "Design", and "type", and attribute, "surv" valued as "survDiff".
An object returned by function bayesCox
.
An optional data frame used to generate a design matrix. Note that it must lead to a design matrix with two different design.
An optional character value indicating the type of function to
compute. The possible values are "survival" and "cumhaz". The former
means the estimated survival function; the latter represents the
estimated cumulative hazard function for the given newdata
.
A numerical value between 0 and 1 indicating the level of cradible band.
Other arguments for further usage.
The estimated difference between survival curves is a step function representing the difference between the posterior mean survival proportion at the given time grid from the posterior sample. Its credible interval is constructed based on the quantiles of all the pair difference between the survival curves from posterior sample at given credible level.
Wang, W., Chen, M. H., Chiou, S. H., Lai, H. C., Wang, X., Yan, J., & Zhang, Z. (2016). Onset of persistent pseudomonas aeruginosa infection in children with cystic fibrosis with interval censored data. BMC Medical Research Methodology, 16(1), 122.
bayesCox
, survCurve
, and plotSurv
.
## See the examples in bayesCox.
Run the code above in your browser using DataLab