Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 4.41 KB

README.md

File metadata and controls

86 lines (61 loc) · 4.41 KB

failCompare


failCompare is a package for fitting and comparing failure-time/survival models from among the F distribution and vitality families. The package facilitates the visualization and ranks the performance of the various models using the Skalski and Whitlock (2020) goodness-of-fit measure. Dependencies include the survival, flexsurv, and Vitality R packages. Additional features include: (1) handling of Type I and Type II right-censored data, (2) specialized plotting for examining model fit, and (3) generalized one-sample Kolmogorov-Smirnov tests of lack-of-fit (Lilliefors 1967).

User manual: failCompare (Version 1.0)

The package was developed by Columbia Basin Research (CBR), an interdisciplinary research center in the School of Aquatic and Fishery Sciences at the University of Washington whose mission is to develop quantitative approaches and provide user-friendly tools to aid in the study of endangered salmonid stocks in the western North America.

Please visit the failCompare page on the CBR website to download the binary version of the package, view the current user manual, and access additional information on this and other software tools.

Creators: Steve Whitlock, Rebecca Buchanan, and Rich Townsend

Releases

-11/30/2021 on the CBR site
-Coming soon to CRAN

License: GPL-3

Installation

Dependencies

failCompare depends upon a prior installation of the following survival, flexsurv, and vitality R packages. Run the following code to install or update these packages

install.packages(c("survival", "flexsurv", "vitality"))

From binary

Download (.zip) file here: failCompare (Version 1.0)

Select the option for "installing package(s) from local files..." or enter:

utils:::menuInstallLocal()

Navigate to and select the downloaded .zip folder.

From source code

If package devtools is installed:

devtools::install_github("Columbia-Basin-Research-West/failCompare")

Rtools must also be installed to build a package from the source code. Instructions for installing Rtools (on Windows and Mac OS X) may be found on the CRAN main site.

Usage

For detailed descriptions and examples, please refer to the user manual PDF on the CBR website:
failCompare Manual (Version 1.0)

Main Functions

fc_fit()

The model fitting routine used to fit one or a set of failure time models. If multiple models are specified an "fc_list" is created containing output from all model fits.

# Where "failure_times" is a numeric vector of only positive values
# Fitting a 3-parameter Weibull model
mod_obj <- fc_fit(time=failure_times, model="weibull3")

The following code defines a list of four models to be ranked: (1) Gompertz; (2) 3-parameter Weibull; (3) Vitality 2009 ; and (4) Vitality 2013 models

mod_list <- fc_fit(time, model=c("gompertz","weibull3,"vitality.ku","vitality.4p"))

fc_rank()

Ranks the performance of the model using the Skalski and Whitlock (2020) goodness-of-fit measure.

# Ranking the list of model
fc_rank(mod_list)

fc_test()

Provides lack-of-fit testing for a single model based on a Monte Carlo simulation with 10k iterations

fc_test(time=failure_times,model=mod_obj,iters=10000)

Association with cbrATLAS package

Once a failure model object (of class fc_obj) has been created it may be used to adjust for tag failure in a CJS model fit using the R pacakge cbrATLAS package.