Learn R Programming

parmsurvfit

This package executes simple parametic models for right-censored survival data. Functionality emulates capabilities in Minitab, including fitting right-censored data, assessing fit, plotting survival functions, and summary statistics and probabilities.

Installation

You can install parmsurvfit from github with:

# install.packages("devtools")
devtools::install_github("apjacobson/parmsurvfit")

Examples

library(parmsurvfit)

Fitting data and assessing fit:

fit_data(data = firstdrink, dist = "weibull", time = "age")
#> Fitting of the distribution ' weibull ' on censored data by maximum likelihood 
#> Parameters:
#>        estimate
#> shape  2.536106
#> scale 19.684061
plot_density(data = firstdrink, dist = "weibull", time = "age")

plot_ppsurv(data = firstdrink, dist = "weibull", time = "age")

compute_AD(data = firstdrink, dist = "weibull", time = "age")
#> [1] 315.5693

Survival functions:

plot_surv(data = firstdrink, dist = "weibull", time = "age")

plot_haz(data = firstdrink, dist = "weibull", time = "age")

plot_cumhaz(data = firstdrink, dist = "weibull", time = "age")

Summary statistics and probabilities:

surv_prob(data = firstdrink, dist = "weibull", x = 30, lower.tail = F, time = "age")
#> P(T > 30) = 0.05439142
surv_summary(data = firstdrink, dist = "weibull", time = "age")
#> shape        2.536106
#> scale        19.68406
#> Log Liklihood    -3170.779
#> AIC      6345.557
#> BIC      6355.373
#> Mean     17.47135
#> StDev        7.380763
#> First Quantile   12.04374
#> Median       17.03536
#> Third Quantile   22.38974

Copy Link

Version

Install

install.packages('parmsurvfit')

Monthly Downloads

204

Version

0.1.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Ashley Jacobson

Last Published

December 7th, 2018

Functions in parmsurvfit (0.1.0)

plot_haz

Plotting parametric hazard curves
surv_summary

Summary statistics based on parametric distribution
surv_prob

Survival probability based on parametric distribution
rearrest

Data on time until re-incarceration for 194 inmates.
plot_ppsurv

Plotting percent-percent plots for parametric fitting of data
plot_surv

Plotting parametric survival curves
parmsurvfit

parmsurvfit: Fitting right censored data to parametric distributions.
oscars

Data on time until actors receive their first Academy Award nomination
fit_data

Fitting right censored survival data to distribution
compute_AD

Anderson-Darling goodness of fit test statistic
plot_cumhaz

Plotting parametric cumulative hazard curves
aggressive

Data on time until drivers honked their horn when being blocked from an intersection
graduate

Data on time until graduation for 1000 college students.
firstdrink

Data on age at first drink of alcohol.
plot_density

Plotting density function overlayed on top of a histogram of data