hazard {survextrap} | R Documentation |
Estimates of hazard from a survextrap
model
Description
Estimates of the hazard function at particular times, from a
survextrap
model
Usage
hazard(
x,
newdata = NULL,
t = NULL,
tmax = NULL,
niter = NULL,
summ_fns = NULL,
sample = FALSE,
newdata0 = NULL,
wane_period = NULL,
wane_nt = 10
)
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 |
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). |
summ_fns |
A list of functions to use to summarise the posterior sample.
This is passed to |
sample |
If |
newdata0 |
Data frame of covariate values defining the "untreated" group
for use in treatment waning models. See |
wane_period |
Vector of two numbers, defining the time period over which
the hazard is interpolated between the hazard of the "treated" group (taken from |
wane_nt |
Number of intervals defining the piecewise constant approximation to the hazard during the waning period. |
Value
A data frame (tibble) giving posterior summary statistics,
or (if sample=TRUE
) an array giving samples from the
posterior.