fccp_closed0: Cohort Component Population Projection Model based on a...

Description Usage Arguments Value Examples

Description

A cohort component projection model based on a closed female population,

N(t+1) = L[t, t+1] N(t)

where the Leslie matrix, eqnL, is created given user defined age specific fertility and survivorship rates.

Usage

1
2
3
4
5
6
7
fccp_closed0(n = NULL, x = NULL, p = NULL, Nx = NULL, sx = NULL,
  fx = NULL, sn = NULL, sex_ratio = 1/(1 + 1.05), tidy_output = TRUE,
  age_lab = x, gender_lab = "Female", ...)

fccp_closed(n = NULL, x = NULL, p = NULL, Nx = NULL, sx = NULL,
  fx = NULL, sn = NULL, sex_ratio = 1/(1 + 1.05), tidy_output = TRUE,
  age_lab = x, gender_lab = "Female", ...)

Arguments

n

Numeric value for the number of projection steps.

x

Vector containing a character string of age group labels.

p

Numeric value for step size of the population projection.

Nx

Vector containing numeric values of the initial female population size in each age group (x).

sx, fx

Vectors containing numeric values of the age specific female survival and fertility rates.

If fccp_closed0 is used a single vector is required.

If fccp_closed is used a matrix of period specific rates is required, where rows represent age groups and columns future periods. If a single vector is passed to fccp_closed a matrix based on constant assumptions in all future rates will be constructed.

sn, sex_ratio

Numeric value of the survivorship of new-born female babies from birth to the end of the interval and the sex ratio at birth of new-born babies.

If fccp_closed0 is used a single value is required.

If fccp_closed is used a vector of period specific values is required. If a single value is passed to fccp_closed a vector based on constant assumptions in all future rates will be constructed.

tidy_output

Logical value to indicate if projection output should be in a tidy data format (TRUE, the default) or as a matrix where rows represent age and gender groups and columns the projection year.

age_lab, gender_lab

Vector containing a character string of age and gender group labels. Only used if projection output is in a tidy data format. See tidy_pp for more details.

...

Additional arguments passed to tidy_pp to build a tidy data frame (if chosen from tidy_output).

Value

Projected populations by age and gender for n future steps, given the age specific fertility and survivorship rates. Depending on the tidy_output value the projections will be returned as either a matrix or a tibble. Both versions contain the initial population sizes given in Nx.

fccp_closed0 produces population projections based strictly on constant future rates.

fccp_closed produces population projections based non-constant future rates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
df0 <- sweden1993

# matrix output
fccp_closed0(n = 5, x = df0$x, p = 5, Nx = df0$Nx_f,
             sx = df0$sx_f, fx = df0$fx, sn = df0$Lx_f[1]/(5*100000),
             tidy_output = FALSE)

# tidy data frame output
fccp_closed0(n = 5, x = df0$x, p = 5, Nx = df0$Nx_f,
             sx = df0$sx_f, fx = df0$fx, sn = df0$Lx_f[1]/(5*100000),
             year0 = 1993, age_lab = df0$age)

# setting up non-constant future age specific fertility rates
ff <- matrix(df0$fx, nrow = length(df0$fx), ncol = 5)
ff <- sweep(ff, 2, seq(from = 1, to = 1.5, length = 5), "*")
# tfr increase
5 * colSums(ff)
# run projection with increasing fx, sx remains constant
fccp_closed(n = 5, x = df0$x, p = 5, Nx = df0$Nx_f,
            sx = df0$sx_f, fx = ff, sn = df0$Lx_f[1]/(5*100000),
            tidy_output = FALSE)

gjabel/demoproj documentation built on May 17, 2019, 6:01 a.m.