calcKMCurves: Return lists to be used in plotting Kaplan-Meier survival...

View source: R/calcKMCurves.R

calcKMCurvesR Documentation

Return lists to be used in plotting Kaplan-Meier survival curves

Description

This function takes the output from the functions used to make the survival data for the known dead, presumed alive, and presumed dead animals, and prepare the survivorship information needed to plot the KM curves. If needed, we can vary the interval over which the survivorship is calculated. And we can store uncertainty around the death times through the use of a boot strap

Usage

calcKMCurves(
  survdf,
  kdpasurvldf,
  nboot = 1,
  dcut,
  increment = 12,
  medProb = TRUE
)

Arguments

survdf

is the data frame containing survival data for all animals in the three possible categories.

kdpasurvldf

is the data frame containing survival data for just the known dead and presumed alive animals

nboot

an integer indicating the number of times we want to run a bootstrap to collect uncertainty around the survivorship. Default is to not run a boot strap

dcut

integer indicating the month-year combo when the sightings data are considered complete through

increment

the unit of time overwhich we calculate survivorship Default value is to calculate it over a yearly interval

medProb

A logical indicating whether or not the median estimate of death is returned from the getDeaths() function. If TRUE, yes. If FALSE, then a value sampled from the posterior with normalised probability for all candidate death months

Value

A list with two elements: 1) kmlines and 2) censTicks. The first element is a data frame of the survivorship for the different time frames. The second element is a data frame of censor times - simply used to make tick marks of when the animal was removed from the study via censoring.

Examples

## Not run: 
calcKMCurves(survdf, kdpasurvldf, nboot = 1, dcut, increment = 12, medProb = TRUE)

## End(Not run)

robschick/tangled documentation built on May 9, 2022, 4:07 p.m.