Guide to Using parmsurvfit

Ashley Jacobson & Victor Wilson

Introduction

The motivation for this package is to create functions that display output for Survival Analysis that are easily available in Minitab, but much more difficult to obtain in R. All of the functions in this package are assuming that the data follows a specified parametric distribution. Some examples of some of the items that are readily available in Minitab but not in R, that we attempted to easily recreate in R are as follows:

Fitting Right Censored Survival Data

In order for any of the functions in this package to work, the dataset must be formatted correctly, using the ‘fit_data’ function, which fits right censored data to a distribution using maximum likelihood estimates. This function is very similar to the ‘fitdistcens’ function which is already available in R via the fitdistrplus package, but is specifically set up to deal with datasets that are designed for survival analysis.

Example

Plotting Survival Curves

The ‘plot_surv’ function plots the survival curve of right censored data, once it has been formatted using the fit_data function, given that it follows a specified parametric distribution. Plotted on the x-axis is time after start of observation, and plotted on the y-axis is proportion of subjects surviving.

Example

As seen in this survival curve, roughly 40% of rats are estimated to survive beyond time t = 200.

Plotting Hazard Curves

The ‘plot_haz’ function plots the hazard curve of right censored data, given that it follows a specified parametric distribution. The hazard displays the conditional risk that a subject will experience the event of interest in the next instant of time, given that the subject has survived beyond a certain amount of time.

Example

Plotting Cumulative Hazard Curves

The ‘plot_cumhaz’ funtion plots the cumulative hazard curve of right censored data, given that it follows a specified parametric distribution. It is important to note that the cumulative hazard function is neither a probability nor a rate, it is merely an accumlation of hazard rates over time.

Example

Computing Survival Probabilities

This function computes survival probabilites, given that the data follows a specified parametric distribution. The output in this function represents the estimated probability that a subject does not experience the event of interest beyond a specified time t.

Example

Here we see that using the rats dataset found in the survival package, assuming that the data follows a log-normal distribution, the probability that a rat survives beyond 110 days is roughly 0.8.

Computing Summary Statistics

Another form of output that is easily computed in Minitab but not in R are various summary statistics based on a specified parametric distribution. We developed the ‘surv_summary’ function to combat this. This function estimates various statistics, including mean, median, standard deviation, and percentiles of survival time given that the data follows a specified parametric distribution.

Example