Software

bayesTFR   bayesLife   bayesPop   bayesDem   wppExplorer & data

All packages described below are available on CRAN. Development versions are available from GitHub.

bayesTFR

bayesTFR is an R package for probabilistic projections of the total fertility rate (TFR). It implements the Bayesian hierarchical model described in Alkema et al. (2011). Ševčíková et al. (2011) gives more detail about the package.

A converged simulation from WPP2015 that can be used for exploring TFR projections using the package can be found here (96M). (It has 3×62000 long MCMCs of phase II and 3×70000 long MCMCs of phase III, both thinned by 30. Projections contain 1000 trajectories.) The directory has a README file with the code used to produce this simulation.

After unpacking into a directory say 'my_path', use the commands

> tfdir <- 'my_path/TFR/sim03092016'
> m2 <- get.tfr.mcmc(tfdir)
> m3 <- get.tfr3.mcmc(tfdir)

to retrieve the MCMC Phase II and Phase III objects, respectively, and the command

> pred <- get.tfr.prediction(tfdir)

to retrieve the prediction object. Follow instructions from the package documentation to explore results.
[top]

bayesLife

bayesLife is an R package for probabilistic projections of life expectancy (e0). It implements the Bayesian hierarchical model described in Raftery et al. (2013).

An MCMC estimation of the e0 parameters can take a long time to run, therefore we provide here results from a converged simulation (using WPP2015 data), including predictions. It consists of 3 chains, 160,000 iterations each, with thin being 50 and 1000 projection trajectories (151M) for both, the female and male e0. The directory has a README file with the code used to produce this simulation.

After unpacking into a directory say 'my_path', use the commands

> e0dir <- 'my_path/e0/sim03092016'
> m <- get.e0.mcmc(e0dir)

to retrieve the MCMC object, and the command

> pred <- get.e0.prediction(e0dir)

to retrieve the prediction object. Follow instructions from the package documentation to view results. Please note that trajectories for 23 countries with generalized HIV/AIDS epidemics are only illustrative and do not correspond to the UN projections for those countries.
[top]

bayesPop

bayesPop is an R package for probabilistic population projections using outputs from bayesTFR and bayesLife as inputs. Raftery et al. (2012) describes the methodology.
Ševčíková et al. (2014) gives more technical details.
[top]

bayesDem

bayesDem is an R package that implements a graphical user interface (GUI) for bayesTFR, bayesLife and bayesPop.

Notes on installation:
The bayesDem package is based on the GTK+ toolkit. On Windows, install it from here. Mac users need a special version that works with R which can be downloaded from here. If there is a problem, this might help. Once GTK+ is installed, install bayesDem including all its dependencies, for example using the package installer of RGui (on Windows) or R.app GUI (on Mac). If you happen to run into an error in R due to missing GTK, make sure you close your R session, install GTK and launch R again.
[top]

Exploring WPP datasets

Data on the World Population Prospects published by the United Nations Population Division are available in R packages wpp2015, wpp2012, and wpp2010. They also include probabilistic projections derived by the UN using the methodology above.

An interactive interface for exploration of the data is available in the shiny-based R package wppExplorer, or online.
[top]