Skip to contents

The longevity package proposes estimation routines for modeling excess lifetime. Core functionalities include maximum likelihood estimation for parametric models (exponential, Gompertz, Weibull, generalized Pareto, extended generalized Pareto, piecewise generalized Pareto), threshold selection plots for survival data, nonparametric maximum likelihood estimation, profile likelihood estimation for the endpoint of the distribution of exceedances.

Installation

You can install the development version of longevity from GitHub with:

# install.packages("devtools")
devtools::install_github("lbelzile/longevity")

Current features

  • maximum likelihood estimation routines
  • simulation of left-truncated and right-truncated/right-censored data
  • hazard plots with profile-likelihood based confidence intervals
  • threshold selection diagnostics with profile and Wald pointwise confidence intervals
  • quantile-quantile plots
  • likelihood ratio tests for nested models
  • likelihood ratio tests for a categorical explanatory
  • score and likelihood ratio tests for piecewise generalized Pareto distribution, extending Northrop and Coleman (2014), with p-value paths
  • nonparametric maximum likelihood estimate of the distribution function with arbitrary truncation and censoring using the EM algorithm of Turnbull (1976) - C++ implementation.
  • profile likelihood for generalized Pareto (endpoint)
  • Adapt npsurv for interval censoring
  • S3 methods
  • hazard functions for all parametric models, using helife

Improvements

  • Add logistic-type models, including distributions, optimization routines, tests
  • Add empirical distribution function for npelife and npsurv
  • Fix npsurv and add weighting argument to Cpp routine.
  • Remove Kolmogorov-Smirnov test (depending on whether it makes sense given null distribution)
  • Change procedure for Q-Q plots and other graphical diagnostics

Testing

  • Check np_elife for the case of
    1. right-censoring
    2. left-truncation (Bell-Lynden estimator)
    3. left-truncation and right-censoring (Tsai, Jewell and Wang)
    4. Frydman (1994) correction for interval censored truncated data
    5. double truncation
  • Check functions fail when packages listed in ‘Suggests’ are absent
  • Check all distributions and proper nesting relationships
  • Check that all ANOVA nesting works as expected (with null distribution)
  • Check distributions
  • Fix starting values for gomp and gompmake and make sure model is as good as submodel
  • Verify fitting procedure in multiple instances, including interval censoring, left and right truncation, etc.
  • Check all plots type are produced with both base R and ggplot2, and ellipsis works as expected

Package on CRAN

  • Add tests
  • Add examples for each function
  • Add vignettes
  • Use pkgdown to create a webpage
  • Root out data sets that cannot go on CRAN (with accompanying doc)
  • Submit to the CRAN