plot_hazard_ratio {survextrap} | R Documentation |
Plot hazard ratio against time from a survextrap model
Description
For use with non-proportional hazards models (survextrap(...,nonprop=TRUE)
). Intended as a quick check of a model fit, so there are
limited customisation options.
The underlying data can be extracted with hazard_ratio
.
Usage
plot_hazard_ratio(
x,
newdata = NULL,
t = NULL,
tmax = NULL,
niter = NULL,
ci = TRUE,
xlab = "Time",
ylab = "Hazard ratio",
line_size = 1.5,
ci_alpha = 0.2
)
Arguments
x |
A fitted model object as returned by |
newdata |
A data frame with two rows. The hazard ratio will
be defined as hazard(second row) divided by hazard(first row).
If the only covariate in the model is a factor with two levels,
then Standardisation (with |
t |
Vector of times at which to compute the estimates. |
tmax |
Maximum time at which to compute the estimates. If
|
niter |
Number of MCMC iterations to use to compute credible intervals. Set to a low value to make this function quicker, at the cost of some approximation error (which may not be important for plotting or model development). |
ci |
If |
xlab |
X-axis label |
ylab |
Y-axis label |
line_size |
Passed to |
ci_alpha |
Transparency for the credible interval ribbons |
Value
A ggplot2
plot object.