get_priors | R Documentation |
Call flexsurvreg to fit an unconditional survival model and return obtain priors
get_priors(data, time_failure, failure, horizon, interval, dist = "weibull")
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() |
a priori survival and failure probabilities (1-survival) for every interval between min landmark and max horizon
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.