Learn R Programming

bayesLife (version 5.2-0)

e0.joint.plot: Joint Posterior Distribution of Female and Male Life Expectancy

Description

The functions plot the joint posterior distribution of female and male life expectancy, modeled and predicted using the joint model described in Lalic (2011) and Raftery, Lalic & Gerland (2014). This can be done for one country (e0.joint.plot) or for all countries (e0.joint.plot.all).

Usage

e0.joint.plot(e0.pred, country, pi = 95, years, nr.points = 500, 
    obs.pch = 17, obs.cex=1, xlim = NULL, 
    ylim = NULL, xlab = "Female life expectancy", ylab = "Male life expectancy", 
    main = NULL, col = NULL, show.legend = TRUE, add = FALSE, ...)
    
e0.joint.plot.all(e0.pred, output.dir = file.path(getwd(), "e0joint"),
    output.type = "png", verbose = FALSE, ...)

Arguments

e0.pred

Object of class bayesLife.prediction containing female projections.

country

Name or numerical code of a country. It can also be given as ISO-2 or ISO-3 characters.

pi

Probability interval. It can be a single number or an array.

years

Array of future years for which to plot the distribution.

nr.points

Number of points shown in the plot for each year.

obs.pch, obs.cex

Graphical parameters used for displaying observed data or data without variation.

xlim, ylim, xlab, ylab, main

Graphical parameters passed to the plot function.

col

Array of colors, one for each year.

show.legend

Logical controlling whether the legend should be drawn.

add

Logical controlling whether the distribution should be plotted into a new graphic device (FALSE) or into an existing device (TRUE).

output.dir

Directory into which resulting graphs are stored.

output.type

Type of the resulting files. It can be “png”, “pdf”, “jpeg”, “bmp”, “tiff”, or “postscript”.

verbose

Logical switching log messages on and off.

...

Additional graphical parameters passed to the lines function drawing ellipses. In addition, for e0.joint.plot.all, ... contains any of the arguments of e0.joint.plot.

Author

Hana Sevcikova, Adrian Raftery

References

Lalic, N. (2011). Master's thesis at the Department of Statistics, University of Washington.

A. E. Raftery, N. Lalic, P. Gerland (2014). Joint Probabilistic Projection of Female and Male Life Expectancy. Demographic Research, 30:795-822.

See Also

e0.gap.plot, e0.trajectories.plot, e0.jmale.predict

Examples

Run this code
# See example for e0.jmale.predict

Run the code above in your browser using DataLab