shape_surv: Calculate shape of survival over age

View source: R/shape_surv.R

shape_survR Documentation

Calculate shape of survival over age

Description

Calculates a 'shape' value of survival lifespan inequality by comparing the area under a survival curve (over age) with the area under a constant survival function.

Usage

shape_surv(surv, xmin = NULL, xmax = NULL, trunc = FALSE, ...)

Arguments

surv

Either 1) a numeric vector describing a survival curve (lx), 2) a data.frame / list with one column / element titled 'lx' describing a survival curve, optionally a column / element 'x' containing age classes (each element a number representing the age at the start of the class), or 3), a matrix, specifically the U submatrix of a matrix population model (A).

In case (2) If x is not supplied, the function will assume age classes starting at 0 with time steps of 1 unit of the ProjectionInterval. If x begins at 0 then lx[1] should equal 1. If x ends at maximum longevity, then lx[which.max(x)] should equal 0; however it is possible to supply partial survivorship curves.

xmin, xmax

The minimum and maximum age respectively over which to evaluate shape. If not given, these default to min(x) and max(x) respectively.

trunc

logical determining whether to truncate life tables or not when any lx == 0. Usually this is the case only for the final value of lx. As the function calculates log(lx), these value(s) cannot be handled. trunc == TRUE strips out the zero value(s). An alternative to this is to transform the zeroes to something approximating zero (e.g., 1e-7).

...

Additional variables passed to 'mpm_to_lx', if data are supplied as a matrix.

Value

a shape value describing lifespan inequality by comparing the area under a survival (lx) curve over age with the area under a constant (Type II) survival function. The shape value may take any real value between -0.5 and +0.5. A value of 0 indicates negligible ageing (neither generally increasing nor generally decreasing survival with age); negative values indicate negative senescence (generally increasing survival with age); positive values indicate senescence (generally decreasing survival with age). A value of +0.5 indicates that all individuals die at age of maximum longevity; a value of -0.5 indicates that (hypothetically) all individuals die at birth.

Author(s)

Iain Stott <iainmstott@gmail.com>

See Also

Other life history traits: entropy_d(), entropy_k(), gen_time(), life_expect_mean(), longevity(), net_repro_rate(), repro_maturity, shape_rep()

Examples

# exponential decline in lx yields shape = 0
lx <- 0.7^(0:20)
shape_surv(lx)

data(mpm1)
shape_surv(mpm1$matU)

lx <- mpm_to_lx(mpm1$matU, start = 1)
shape_surv(lx)


Rage documentation built on Sept. 30, 2023, 1:06 a.m.