best_model: Find best-fitted model

Description Usage Arguments Value Examples

View source: R/utils.R

Description

This utility function used by the 'rwToT' package returns the best-fitted parametric distribution model for the given Survival/Treatment data. This function uses flexsurv package for parametric modeling for time-to-event data. Parametric model using built-in distribution such as Weibull(scale), Gamma(rate), Exponential(rate), Log-logistic(scale), Log-normal(meanlog), and Gompertz(rate) gets evaluated and best model is selected based on lowest AIC value. The function also returns the restricted mean of the KM curve up to chosen time t.

Usage

1
best_model(df_cohort, t)

Arguments

df_cohort

A dataframe. Minimum required columns:

  • STATUS : Censor status (0 = censored, 1 = event)

  • DD : The follow up time

t

A numeric value: the time point of interest

Value

Best-fitted model 'output_model' and restricted mean of the KM curve up to chosen time t

Examples

1
2
# Find best-fitted model for AML dataset.
best_model(rwToT_aml,20)

sutsabs/rwToT2 documentation built on Feb. 18, 2022, 2:30 a.m.