Learn R Programming

paramDemo (version 1.0.2)

plot.paramDemoLT: Functions to plot life tables and product limit estimators

Description

Draw a plot of demographic rates from a life table produced with function CalcLifeTable or of product limit estimator produced with function CalcProductLimitEst

Usage

# S3 method for paramDemoLT
plot(x, demorate = "lx", inclCIs = FALSE, ...)

# S3 method for paramDemoPLE plot(x, inclCIs = FALSE, ...)

Value

No return value, called for plotting objects of class “paramDemoLT

Arguments

x

Object of class paramDemoLT or paramDemoPLE produced with functions CalcLifeTable or CalcProductLimitEst

demorate

Demographic rate to be plotted, choices are “lx” for the survival, “px” for the age-specific survival probability, “qx” for the age-specific mortality probability, and “ex” for the remaining life expectancy

inclCIs

Logical indicating whether confidence intervals should be ploted in case they were calculated with function CalcLifeTable or CalcProductLimitEst

...

Additional arguments passed to function plot

Author

Fernando Colchero fernando_colchero@eva.mpg.de

See Also

CalcLifeTable to calculate life tables. CalcProductLimitEst to calculate product limit estimators.

Examples

Run this code
# Simulate age at death data from Gompertz model:
ages <- SampleRandAge(n = 100, theta = c(b0 = -5, b1 = 0.1))

# Calculate life table:
lt <- CalcLifeTable(ageLast = ages, departType = rep("D", 100))

# Plot life table:
plot(lt)

Run the code above in your browser using DataLab