get_priors: Get priors

get_priorsR Documentation

Get priors

Description

Call flexsurvreg to fit an unconditional survival model and return obtain priors

Usage

get_priors(data, time_failure, failure, horizon, interval, dist = "weibull")

Arguments

data

a data.frame with the data for which to predict in the long format (input should be the same as likelihood_profiles).

time_failure

a character with the failure time variable name.

failure

a character with the failure indicator variable name.

horizon

a 1L int with the prediction horizon.

interval

the intervals relative to the horizon (e.g. 1/12 for monthly intervals and horizon is in years)

dist

distribution parameter for the survreg()

Value

a priori survival and failure probabilities (1-survival) for every interval between min landmark and max horizon

Examples

## Not run: 
# Return prior up to a horizon of 5 (years) at 3 month intervals.
get_priors(data=df,
  time_failure="ftime",
  failure="failure",
  horizon=5,
  interval=1/4
)

## End(Not run)

JanvandenBrand/jmmm documentation built on May 30, 2022, 9:37 a.m.