The functions plot the posterior distribution of the gaps between female and male life expectancy, modeled and predicted using a model described in Lalic (2011) and Raftery, Lalic & Gerland (2014). This can be done for one country (e0.gap.plot
) or for all countries (e0.gap.plot.all
).
e0.gap.plot(e0.pred, country, e0.pred2 = NULL, pi = c(80, 95),
nr.traj = 0, xlim = NULL, ylim = NULL, type = "b",
xlab = "Year", ylab = "Gap in life expectancy", main = NULL,
show.legend = TRUE, ...)
e0.gap.plot.all(e0.pred, output.dir = file.path(getwd(), "e0gaps"),
output.type = "png", verbose = FALSE, ...)
Object of class bayesLife.prediction
containing female projections. If e0.pred2
is not given, then this object must contain the ‘joint.male’ component, generated using the e0.jmale.predict
function.
Name or numerical code of a country. It can also be given as ISO-2 or ISO-3 characters.
Object of class bayesLife.prediction
containing male projections. By default the male projections is taken from the joint female-male projections in e0.pred
, see above.
Probability interval. It can be a single number or an array.
Number of trajectories to be plotted.
Graphical parameters passed to the plot
function.
Logical controlling whether the legend should be drawn.
Directory into which resulting graphs are stored.
Type of the resulting files. It can be “png”, “pdf”, “jpeg”, “bmp”, “tiff”, or “postscript”.
Logical switching log messages on and off.
Additional graphical parameters. In addition, for e0.gap.plot.all
, ...
contains any of the arguments of e0.gap.plot
.
Hana Sevcikova
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.
e0.joint.plot
, e0.jmale.estimate
, e0.jmale.predict
, get.e0.jmale.prediction
# See example for e0.jmale.predict
Run the code above in your browser using DataLab