pop.trajectories.plot(pop.pred, country = NULL, expression = NULL, pi = c(80, 95),
sex = c("both", "male", "female"), age = "all", sum.over.ages = FALSE,
half.child.variant = FALSE, nr.traj = NULL, typical.trajectory = FALSE,
main = NULL, dev.ncol = 5, lwd = c(2, 2, 2, 2, 1),
col = c('black', 'red', 'red', 'blue', 'gray'), show.legend = TRUE,
ann = par('ann'), ...)
pop.trajectories.plotAll(pop.pred,
output.dir=file.path(getwd(), "pop.trajectories"),
output.type="png", expression = NULL, verbose=FALSE, ...)
pop.trajectories.table(pop.pred, country = NULL, expression = NULL, pi = c(80, 95),
sex = c("both", "male", "female"), age = "all", half.child.variant = FALSE)
pop.byage.plot(pop.pred, country = NULL, year = NULL, expression = NULL,
pi = c(80, 95), sex = c('both', 'male', 'female'),
half.child.variant = FALSE, nr.traj = NULL, typical.trajectory=FALSE,
xlim = NULL, ylim = NULL, xlab = '', ylab = 'Population projection',
main = NULL, lwd = c(2,2,2,1), col = c('red', 'red', 'blue', 'gray'),
show.legend = TRUE, add = FALSE, ann = par('ann'), ...)
pop.byage.plotAll(pop.pred,
output.dir=file.path(getwd(), "pop.byage"),
output.type="png", expression = NULL, verbose=FALSE, ...)pop.byage.table(pop.pred, country = NULL, year = NULL, expression = NULL,
pi = c(80, 95), sex = c('both', 'male', 'female'),
half.child.variant = FALSE)
bayesPop.prediction.pop.expressions. For pop.trajectories.plot, pop.trajectories.table, pop.byage.plot andTRUE, the values are summed up over given age groups. Otherwise there is a separate plot for each age group.NULL, all trajectories are plotted, otherwise they are thinned evenly.TRUE one trajectory is shown that has the smallest distance to the median.plot function.sum.over.ages is FALSE. If the number of age groups is smaller than dev.ncol, the number of columns is automatically decreased.pop.trajectories.plotAll and pop.byage.plotAll accept also any arguments of pop.trajectories.plot and pop.byage.plot, respectively, except country.pop.trajectories.plot plots trajectories of population projection by time for a given country.
pop.trajectories.table gives the same output as a table. pop.trajectories.plotAll creates a set of graphs (one per country) that are stored in output.dir. The projections can be visualized separately for each sex and age groups, or summed up over both sexes and/or given age groups. This is controlled by the arguments sex, age and sum.over.ages.pop.byage.plot and pop.byage.table plots/tabulate the posterior distribution by age for a given country and time period. pop.byage.plotAll creates such plots for all countries.
The median and given probability intervals are computed using all available trajectories. Thus, nr.traj does not influence those values - it is used only to control the number of trajectories plotted.
bayesPop.prediction, summary.bayesPop.prediction, pop.pyramidsim.dir <- file.path(find.package("bayesPop"), "ex-data", "Pop")
pred <- get.pop.prediction(sim.dir)
pop.trajectories.plot(pred, country="Ecuador", pi=c(80, 95))
pop.trajectories.table(pred, country="Ecuador", pi=c(80, 95))Run the code above in your browser using DataLab