calcKMUncertainty: Data frame of 95% uncertainty quantiles for survivorship.

Description Usage Arguments Format Value Examples

View source: R/calcKMUncertainty.R

Description

calcKMUncertainty ingests the list of survivorship information and returns the 2.5, 0.5 and 97.5 quantiles. The goal is to create the data needed to plot the ribbon around the median estimate of survivorship for entangled animals. The processing idea is that we ingest a list, convert it to a big data frame. And then use dplyr to group by the different sex and severity combinations, and for each time interval, calculate the summary statistics

Usage

1

Arguments

kmlines

A list (size nboot) containing information about survivorship.

Format

Each component of the list contains a data frame, which has these 10 columns:

interval

The time slice for which we are recording survivorship. In this case it is a one year interval.

atRiskStart

The number of animals at risk at the start of the interval.

censored

The number of animals censored on the interval.

diedOnInterval

The number of animals that died on the interval.

atRiskEnd

The number of animals at risk at the end of the interval.

propSurv

The proportion of animals that survived the interval. Calculated as atRiskEnd / atRiskStart

gender

The sex of the animal: 'M' == Male; 'F' == Female.

psurv

Survivorship - the cumulative product of proportion of animals that survive.

sev

The label of the entanglement severity. Values include in increasing order of badness: minor, moderate, severe.

group

Simply a vector denoting what iteration each slice corresponds to.

Value

The output will be a data frame of survival information based on the imputed death times. This will include 5 columns:

gender

Sex of the animal.

sev

The label of the entanglement severity. Values include in increasing order of badness: minor, moderate, severe.

interval

The time slice for which we are recording survivorship. In this case it is a one year interval.

low

2.5% Quantile of survivorship.

med

50% Quantile of survivorship.

high

97.5% Quantile of survivorship.

Examples

1
2
3
4
## Not run: 
calcKMUncertainty(kmlines)

## End(Not run)

robschick/tangled documentation built on Dec. 17, 2018, 10:12 a.m.