knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The original goal of demoSynthPop is to recreate the ETHPOP population data using the ETHPOP birth, death, inmigration and outmigration data. This is a check for internal consistency and we will use the same approach to extend for UK born and non-UK born individuals too.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("ETHPOP-and-ETS/demoSynthPop")
ETHPOP data can be downloaded from here.
The ETHPOP data are:
The ethnic groups are: BAN (Bangladeshi), BLA (Black African), BLC (Black Caribbean), CHI (Chinese), IND (Indian), MIX (Mixed), OAS (Other Asian), OBL (Other Black), OTH (Other), PAK (Pakistani), WBI (White British), WHO (White Other)
The ages are individual years from 0 to 99 and a single group for $\geq$ 100.
The calendar years are 2011 to 2061.
The main analysis is in main.R and uses the run_model()
function.
This loops over each year performing the 'demographic arithmetic' of removing and adding individuals according to the ETHPOP tables.
There are two ways in which we can do this:
The algorithm in run_model()
takes the following steps:
age_population()
.add_births()
.add_deaths()
.add_inflow()
.add_outflow()
.library(demoSynthPop)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.