Learn R Programming

demography

The R package demography provides functions for demographic analysis including: lifetable calculations; Lee-Carter modelling; functional data analysis of mortality rates, fertility rates, net migration numbers; and stochastic population forecasting.

Installation

You can install the stable version on R CRAN.

install.packages('demography', dependencies = TRUE)

You can also install the development version from Github

# install.packages("devtools")
library(devtools)
install_github("robjhyndman/demography")

License

This package is free and open source software, licensed under GPL (>= 3).

Copy Link

Version

Install

install.packages('demography')

Monthly Downloads

2,709

Version

2.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

February 8th, 2023

Functions in demography (2.0)

extract.years

Extract some years from a demogdata object
coherentfdm

Coherent functional demographic model for grouped data
demogdata

Create demogdata object from raw data matrices
fdm

Functional demographic model
life.expectancy

Estimate life expectancy from mortality rates
lifetable

Construct lifetables from mortality rates
demography-package

Forecasting mortality and fertility data
isfe

Integrated Squared Forecast Error for models of various orders
lca

Model mortality or fertility data using Lee-Carter approach
plot.lifetable

Plot life expectancy from lifetable
hmd

Read data from HMD and construct a mortality demogdata object
forecast.fdm

Forecast functional demographic model.
pop.sim

Population simulation
fr.mort

French mortality data
plot.demogdata

Plot age-specific demographic functions
forecast.lca

Forecast demogdata data using Lee-Carter method.
models

Show model information for the forecast coefficients in FDM models.
forecast.fdmpr

Forecast coherent functional demographic model.
mean.demogdata

Mean and median functions for data of class demogdata
netmigration

Calculate net migration from mortality and fertility data
plot.fmforecast

Plot forecasts from a functional demographic modell
plot.errorfdm

Plot differences between actuals and estimates from fitted demographic model
set.upperage

Combine the upperages of a demogdata object.
update

Updating functional demographic models and coherent functional demographic models.
read.demogdata

Read demographic data and construct demogdata object
sex.ratio

Compute sex ratios from mortality rates
residuals.fdm

Compute residuals and fitted values from functional demographic model or Lee-Carter model
simulate.fmforecast

Simulate future sample paths from functional demographic model forecasts.
summary.fdm

Summary for functional demographic model or Lee-Carter model
tfr

Compute total fertility rate from fertility rates
smooth.demogdata

Create smooth demogdata functions
as.data.frame.demogdata

Coerce a demogdata object to a data.frame object
combine.demogdata

Combine two demogdata objects into one demogdata object
cm.spline

Monotonic interpolating splines
aus.fert

Australian fertility data
extract.ages

Extract some ages from a demogdata object
compare.demogdata

Evaluation of demographic forecast accuracy