View source: R/user_utilities.R
diag_baseline | R Documentation |
Creates plots to diagnosis fit of different choices of parametric baseline model. Plots the semi paramtric model against different choices of parametric models.
diag_baseline(
object,
data,
model = "ph",
weights = NULL,
dists = c("exponential", "weibull", "gamma", "lnorm", "loglogistic", "generalgamma"),
cols = NULL,
lgdLocation = "bottomleft",
useMidCovars = T
)
object |
Either a formula or a model fit with |
data |
Data. Unnecessary if |
model |
Type of model. Choices are |
weights |
Case weights |
dists |
Parametric baseline fits |
cols |
Colors of baseline distributions |
lgdLocation |
Where legend will be placed. See |
useMidCovars |
Should the distribution plotted be for covariates = mean values instead of 0 |
If useMidCovars = T
, then the survival curves plotted are for fits with the mean covariate value,
rather than 0. This is because often the baseline distribution (i.e. with all covariates = 0) will be
far away from the majority of the data.
Clifford Anderson-Bergman
data(IR_diabetes)
fit <- ic_par(cbind(left, right) ~ gender,
data = IR_diabetes)
diag_baseline(fit, lgdLocation = "topright",
dist = c("exponential", "weibull", "loglogistic"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.