The demography package for R contains functions for various demographic analyses. It provides facilities for demographic statistics, modelling and forecasting. In particular, it implements Lee-Carter forecasting and variations, and Hyndman-Ullah forecasting.

Maintainer: Rob J Hyndman
Authors: Rob J Hyndman, Heather Booth, Leonie Tickle, John Maindonald.

  • Current version of demography: 0.995 (updated 4 March 2009)

Help files

Downloads

Examples

History of changes

Changes in v0.995 (4 March 2009)
  • Fixed bug in pop.sim.
Changes in v0.994 (26 February 2009)
  • Corrected lifetable calculations to work when the sex is unknown.
Changes in v0.993 (4 August 2008)
  • Corrected combine.demogdata() to produce a “pop” object when possible, and modified associated help file accordingly.
  • Updated the lifetable() function to allow five-year age groups.
Changes in v0.992 (3 July 2008)
  • Allowed greater flexibility in fitting stationary coefficients to only some components, and using ar() for stationary models.
  • Changed the default number of terms in an fdm or ftsm model to 6 rather than 3.
  • Bug in smooth.demogdata() fixed and made compatible with latest version of mgcv package.
  • Added color control in plot.ftsm() and plot.fdm()
Changes in v0.991 (12 May 2008)
  • Prediction intervals for fdm objects now allowed using structural time series and random walks with drift.
  • Changed default forecasting method to “arima” in forecast.fdm and forecast.ftsm
  • Corrected time component of coefficients from foreccast.fdm
Changes in v0.99
  • Bug fixes in smooth.demogdata
  • Bug fix in forecast.fdm to allow method=”ets.na” to work again.
Changes in v0.98
  • Updated documentation to conform to new CRAN rules.
  • Added population forecasting functions as described in Hyndman and Booth (2007).
  • Modified the internals of smooth.demogdata() to take account of changes in the R base and stats packages.
  • A few bug fixes.
Changes in v0.97
  • Many changes to documentation and functions to satisfy CRAN checks.
  • Updated all forecasting functions to work with v1.0 of the forecast package. Check help files as some syntax has changed.
  • Various bug fixes.
Changes in v0.96
  • smooth.demogdata slightly modified to give better results.
  • Bug fixes in various functions.
  • Smooth.demogdata handles age-grouping better.
  • Smooth.demogdata no longer crashes if all age groups have zero population in a year.
Major changes in v0.95
  • Most data have now been taken out of the package (as it is now publicly available). The only data sets in the demography package are fr.mort (French mortality) and aus.fert (Australian fertility).
  • The package now handles fertility, mortality and migration data. The basic data class is “demogdata” and demogdata$type indicates the type of demographic data.
  • Many functions have been revised to handle the new data structures. However, I’ve tried to keep the calling syntax the same. If existing code no longer works, check the help files first.
  • fmm has been renamed as fdm as it now fits functional demographic models (and not only functional mortality models).
  • read.mortality has been renamed as read.demogdata. Similarly, other functions of the form xxx.mortality are now called xxx.demogdata.
  • smooth.demogdata now handles various types of smoothing and smoothing constraints. See the help file for details. It tries to do something appropriate depending on the type of data passed. At the moment, it only handles mortality and fertility data.
  • I’ve added tfr to compute total fertility rates, and isfe to compute the Integrated Squared Forecast Error for different model orders.
  • The documentation has been revised in many places, and several references added.
  • All these changes have almost certainly introduced new errors.
  • Share/Bookmark