plot.mortalityTable {MortalityTables} | R Documentation |
Plot multiple mortality tables (life tables) in one plot
Description
plot.mortalityTable
displays multiple life tables (objects of child
classes of mortalityTable
) in one plot, with a legend showing the
names of the tables. If the argument reference
not given, all
mortality rates are plotted on a log-linear scale for comparison. If the
argument reference
is given and is a valid life table, then all
death probabilities are scaled by the given reference table and the y-axis
shows the death rates as percentage of the reference table.
Usage
## S3 method for class 'mortalityTable'
plot(x, ..., reference = NULL, trend = FALSE)
Arguments
x |
First life table to be plotted. Must be a |
... |
Additional life tables to be plotted (
|
reference |
The reference table that determines the 100% values. If not given, the absolute mortality values are compared and plotted on a log-linear scale. |
trend |
If set to |
See Also
plotMortalityTables
and plotMortalityTableComparisons
Examples
# Load the Austrian census data
mortalityTables.load("Austria_Census")
# Plot some select census tables in a log-linear plot
plot(mort.AT.census.1869.male, mort.AT.census.1869.female,
mort.AT.census.1971.male, mort.AT.census.1971.female,
mort.AT.census.2011.male, mort.AT.census.2011.female,
title="Austrian census tables",
ylab=expression(q[x]), xlab="Age",
xlim=c(0,90),
legend.position=c(0.95,0.05))
# Compare some census tables with the mortality of 2011 Austrian males
plot(mort.AT.census.1869.male, mort.AT.census.1869.female,
mort.AT.census.1971.male, mort.AT.census.1971.female,
mort.AT.census.2011.male, mort.AT.census.2011.female,
title="Austrian Census tables, relative to 2011 males",
reference=mort.AT.census.2011.male)