Description Usage Arguments Details Value Examples
View source: R/multi_surv_reg.R
Finds best suvreg adjust
1 2 | multi_surv_reg(surv_data, time_col = "time", status_col = "status",
surv_formula = "~ 1", dist_list = "", ...)
|
dist_list: |
A vector containing a list of distributions to fit survival models and pick the best. |
status_col: |
The ame of the column containing the status |
surv_data: |
a |
surv_formula: |
A |
time_col: |
name of the column containing the time |
...: |
further arguments for flexsurvreg() |
All distributions in the dist_list are used as link functions for the survival regresion model. The models are returned in the models slot of the result, ordered by best fit. The slot erros contains the fits that had erros. Adjust_table contains the goodness of fit of the models. ff_table contains the faulire frequency table. KM_fit has the Kaplan-Meier fit.
A list containing the best survreg fits
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | da = system.file("extdata", "example.csv", package = "reliabilitytools")
da = read.csv2(da)
da_status = da %>%#'
mutate(status = as.integer(failure_cause_group == 560)) # cause of failure
# -- prepare life data
da_prepared = prepare_life_times(da_status
, indiv_col = 'id'
, status_col = 'status'
, obs_time_col = 'cycles')
# -- suvival models
surv_model = multi_surv_reg(da_prepared
, time_col = 'elapsed'
, status_col = 'status')
# -- plot
plot_life_curve(surv_model$models,
title_aux = '\nFailure cause: 560')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.