Learn R Programming

pammtools (version 0.8.1)

get_hazard: Point hazard predictor (backend primitive)

Description

Returns the predicted hazard (response scale) as a plain numeric vector, one value per row of newdata. Together with sim_hazard this is the only primitive a new estimation backend must provide: every derived quantity (cumulative hazard, survival probability, CIF, transition probabilities) and its simulation-based confidence intervals are built from these two. Analytic ("default"/"delta") confidence intervals additionally use make_X/get_coefs/get_Vp.

Usage

get_hazard(object, newdata, ...)

# S3 method for default get_hazard(object, newdata, ...)

Value

A numeric vector of hazards on the response scale.

Arguments

object

A fitted model object.

newdata

A data frame for which the hazard is predicted.

...

Further arguments passed to methods.

See Also

The package website (https://adibender.github.io/pammtools/) has worked examples of implementing get_hazard and sim_hazard for new estimation backends: the articles “Defining a new backend: gradient boosting with xgboost” (a bootstrap tree ensemble) and “Bayesian Baseline PAMMs” (a brms model, drawing from the posterior).