Description Usage Arguments Value Examples
A cohort component projection model based on a closed female population,
N(t+5) = L[t,t+5] ≤ft( N(t) + \frac{1}{2} I[t,t+5] \right) + \frac{1}{2} I[t,t+5]
where the Leslie matrix, eqnL, is created given user defined age specific fertility and survivorship rates.
1 2 3 4 5 6 7 8 9  | fccp_open0(n = NULL, x = NULL, p = NULL, Nx = NULL, sx = NULL,
  fx = NULL, sn = NULL, sex_ratio = 1/(1 + 1.05), ex = NULL,
  Ix = NULL, tidy_output = TRUE, age_lab = x, gender_lab = "Female",
  ...)
fccp_open(n = NULL, x = NULL, p = NULL, Nx = NULL, sx = NULL,
  fx = NULL, sn = NULL, sex_ratio = 1/(1 + 1.05), ex = NULL,
  Ix = NULL, tidy_output = TRUE, age_lab = x, gender_lab = "Female",
  ...)
 | 
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 (  | 
sx, fx, ex, Ix | 
 Vectors containing numeric values of the age specific female survival, fertility and emigration rates and immigration counts. If  If   | 
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  If   | 
tidy_output | 
 Logical value to indicate if projection output should be in a tidy data format (  | 
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   | 
... | 
 Additional arguments passed to   | 
Projected populations by age and gender for n future steps, given the age specific fertility, survivorship and emigration rates and immigration counts. 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_open0 produces population projections based strictly on constant future rates.
fccp_open produces population projections based non-constant future rates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35  | library(dplyr)
df0 <- sweden1993 %>%
    #immigration from estimated count and net age pattern
    mutate(Ix_f = 138000 * Mx_f/sum(Mx_f),
    Ix_f = round(Ix_f),
    #emigration as remainder
    Ex_f = Ix_f - Mx_f ,
    #emigration rate for projection model
    ex_f = Ex_f/Nx_f)
# matrix output
fccp_open0(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),
           ex = df0$ex_f, Ix = df0$Ix_f,
           tidy_output = FALSE)
# tidy data frame output
fccp_open0(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),
           ex = df0$ex_f, Ix = df0$Ix_f,
           year0 = 1993, age_lab = df0$age)
# setting up non-constant future immigrant counts
II <- matrix(df0$Ix_f, nrow = length(df0$Ix_f), ncol = 5)
II <- sweep(II, 2, seq(from = 1, to = 1.5, length = 5), "*")
# immigration increase
colSums(II)
# run projection with increasing immigration, fx, sx and ex remains constant
fccp_open(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),
          ex = df0$ex_f, Ix = II,
          tidy_output = FALSE)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.