hrtime {survextrap} | R Documentation |
Hazard ratio between high and low values of the hazard over time
Description
This is intended as an intuitive single-number measure of how much a hazard function changes over time. The hazard is computed on an equally-spaced fine grid between the boundary knots. The ratio between a "high" and "low" one of these hazard values is computed. For example, if the hazard is constant over time, then this hazard ratio will be 1.
Usage
hrtime(
x,
newdata = NULL,
niter = NULL,
summ_fns = NULL,
hq = c(0.1, 0.9),
sample = FALSE
)
Arguments
x |
A fitted model object as returned by |
newdata |
Data frame of covariate values to compute the output for. If there are covariates in the model and this is not supplied, the following default is used: (a) if the only covariate is one factor variable, then the output is computed for each level of this factor. (b) if there are multiple covariates, or any numeric covariates, then the output is computed at the mean of each numeric covariate in the original data, and at the baseline level of each factor covariate. Note: caution is required about how treatment groups (for example)
are stored in your data. If these are coded as numeric (0/1),
then 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). |
summ_fns |
A list of functions to use to summarise the posterior sample.
This is passed to |
hq |
Quantiles which define the "low" and "high" values of a
time-varying quantity (hazard in |
sample |
If |
Value
A summary of the posterior distribution of this hazard
ratio from the fitted model, as a data frame with one row per
covariate value requested in newdata
, and one column for each
posterior summary statistic.
Or if sample=TRUE
, an array with dimensions
1
, niter
, and nrow(newdata)
, giving the
incremental RMST evaluated at different MCMC iterations
and covariate values respectively.