Title: | Fertility Models |
---|---|
Description: | Four fertility models are fitted using non-linear least squares. These are the Hadwiger, the Gamma, the Model1 and Model2, following the terminology of the following paper: Peristera P. and Kostaki A. (2007). "Modeling fertility in modern populations". Demographic Research, 16(6): 141--194. <doi:10.4054/DemRes.2007.16.6>. Model based averaging is also supported. |
Authors: | Michail Tsagris [aut, cre] |
Maintainer: | Michail Tsagris <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.4 |
Built: | 2024-11-30 12:24:02 UTC |
Source: | CRAN |
Four fertility models are fitted using non-linear least squares. These are the Hadwiger, the Gamma, the Model1 and Model2, following the terminology of the following paper: Peristera P. and Kostaki A. (2007). Modeling fertility in modern populations. Demographic Research, 16(6): 141–194. <doi:10.4054/DemRes.2007.16.6>.
Package: | nlgmcr Type: | Package |
Version: | 1.4 | |
Date: | 2024-11-29 | |
License: | GPL-2 | |
Michail Tsagris [email protected].
Acknowledgments: This package is dedicated to Sanaa who introduced me to these models and whom I may never see again.
Michail Tsagris [email protected].
Peristera P. and Kostaki A. (2007). Modeling fertility in modern populations. Demographic Research, 16(6), 141–194. <doi:10.4054/DemRes.2007.16.6>.
Model based average of the estimated values from two or more fertility models.
comb(models)
comb(models)
models |
A list with possible models. |
A list including:
weights |
The weights assigned to each model. |
fit |
The weighted fitted age-specific fertility rates |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
rate <- c(0.0001, 0.0006, 0.0033, 0.0111, 0.0263, 0.0412, 0.0544, 0.0622, 0.0660, 0.0704,0.0723, 0.0753, 0.0814, 0.0873, 0.0924, 0.0962, 0.0989, 0.1006, 0.0990, 0.0933,0.0831, 0.0747, 0.0634, 0.0529, 0.0424, 0.0326, 0.0242, 0.0172, 0.0115, 0.0073, 0.0040, 0.0022, 0.0012, 0.0006, 0.0003, 0.0002, 0.0001) age <- 13:49 mod1 <- Hadwiger(rate, age) mod2 <- Gama(rate, age) mod3 <- Model1(rate, age) mod4 <- Model2(rate, age) a <- list(mod1 = mod1, mod2 = mod2, mod3 = mod3, mod4 = mod4) comb(a)
rate <- c(0.0001, 0.0006, 0.0033, 0.0111, 0.0263, 0.0412, 0.0544, 0.0622, 0.0660, 0.0704,0.0723, 0.0753, 0.0814, 0.0873, 0.0924, 0.0962, 0.0989, 0.1006, 0.0990, 0.0933,0.0831, 0.0747, 0.0634, 0.0529, 0.0424, 0.0326, 0.0242, 0.0172, 0.0115, 0.0073, 0.0040, 0.0022, 0.0012, 0.0006, 0.0003, 0.0002, 0.0001) age <- 13:49 mod1 <- Hadwiger(rate, age) mod2 <- Gama(rate, age) mod3 <- Model1(rate, age) mod4 <- Model2(rate, age) a <- list(mod1 = mod1, mod2 = mod2, mod3 = mod3, mod4 = mod4) comb(a)
Plot of the age-specific fertility rates and the estimated values from one or more fertility models.
fertil.plot(rate, age, fit = NULL, grid = FALSE, names = NULL)
fertil.plot(rate, age, fit = NULL, grid = FALSE, names = NULL)
rate |
A vector with the age-specific fertility rates. |
age |
A vector with the age of the women. |
fit |
Here you can specify nothing (omly plot the fertility rates across the ages), or you can specify a vector or a matrix with fitted values from at least one model. |
grid |
Do you want a grid of vertical and horizontal lines? TRUE or FALSE. |
names |
If you provided fitted models from a model, you can specify the name(s) of the model(s) so that they appear as a legend. |
A plot with the age-specific fertility rates across the mothers' age and perhaps the fitted values from at least one model.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
rate <- c(0.0000, 0.0005, 0.0023, 0.0073, 0.0175, 0.0283, 0.0420, 0.0523, 0.0601, 0.0712, 0.0789, 0.0865, 0.0939, 0.0991, 0.1052, 0.1115, 0.1155, 0.1178, 0.1211, 0.1159, 0.1104, 0.1031, 0.0916, 0.0776, 0.0639, 0.0498, 0.0387, 0.0281, 0.0185, 0.0117, 0.0067, 0.0038, 0.0020, 0.0011, 0.0007, 0.0003, 0.0002) age <- 13:49 mod1 <- Hadwiger(rate, age) mod2 <- Gama(rate, age) fertil.plot(rate, age) fertil.plot(rate, age, cbind(mod1$fit, mod2$fit), grid = TRUE, names = c("Hadwiger", "Gama") )
rate <- c(0.0000, 0.0005, 0.0023, 0.0073, 0.0175, 0.0283, 0.0420, 0.0523, 0.0601, 0.0712, 0.0789, 0.0865, 0.0939, 0.0991, 0.1052, 0.1115, 0.1155, 0.1178, 0.1211, 0.1159, 0.1104, 0.1031, 0.0916, 0.0776, 0.0639, 0.0498, 0.0387, 0.0281, 0.0185, 0.0117, 0.0067, 0.0038, 0.0020, 0.0011, 0.0007, 0.0003, 0.0002) age <- 13:49 mod1 <- Hadwiger(rate, age) mod2 <- Gama(rate, age) fertil.plot(rate, age) fertil.plot(rate, age, cbind(mod1$fit, mod2$fit), grid = TRUE, names = c("Hadwiger", "Gama") )
Fertility models.
Hadwiger(rate, age) Gama(rate, age) Model1(rate, age) Model2(rate, age)
Hadwiger(rate, age) Gama(rate, age) Model1(rate, age) Model2(rate, age)
rate |
A vector with the age-specific fertility rates. |
age |
A vector with the age of the women. |
The following fertility models are fitted: Hadwiger:
where is the age of the mother at birth,
is associated with total fertility, the parameter
determines the height of the curve and the parameter
is related to the mean age of motherhood.
Gama:
where represents the lower age at childbearing, while the parameter
determines the
level of fertility.
Model1:
where if
and
if
. The parameter
describes the base level of the fertility curve and is associated with the total fertility rate,
reflects the location of the distribution, i.e. the modal age and
and
reflect the spread of the distribution before and after its peak, respectively.
Model2:
where the parameters and
express the severity i.e. the total fertility rates of the first
and the second hump respectively,
and
are related to the mean ages of the two
subpopulations the one with earlier fertility and the other with fertility at later ages, while
and
reflect the variances of the two humps.
A list including:
param |
The vector of the estimated parameters. |
sse |
The sum of squars of the errors |
fx |
The fitted values, the fitted age-specific fertility rates |
res |
The residuals, |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Peristera P. and Kostaki A. (2007). Modeling fertility in modern populations. Demographic Research, 16(6): 141–194.
rate <- c(0.0001, 0.0006, 0.0033, 0.0111, 0.0263, 0.0412, 0.0544, 0.0622, 0.0660, 0.0704,0.0723, 0.0753, 0.0814, 0.0873, 0.0924, 0.0962, 0.0989, 0.1006, 0.0990, 0.0933,0.0831, 0.0747, 0.0634, 0.0529, 0.0424, 0.0326, 0.0242, 0.0172, 0.0115, 0.0073, 0.0040, 0.0022, 0.0012, 0.0006, 0.0003, 0.0002, 0.0001) age <- 13:49 mod1 <- Hadwiger(rate, age) mod2 <- Gama(rate, age) mod3 <- Model1(rate, age) mod4 <- Model2(rate, age)
rate <- c(0.0001, 0.0006, 0.0033, 0.0111, 0.0263, 0.0412, 0.0544, 0.0622, 0.0660, 0.0704,0.0723, 0.0753, 0.0814, 0.0873, 0.0924, 0.0962, 0.0989, 0.1006, 0.0990, 0.0933,0.0831, 0.0747, 0.0634, 0.0529, 0.0424, 0.0326, 0.0242, 0.0172, 0.0115, 0.0073, 0.0040, 0.0022, 0.0012, 0.0006, 0.0003, 0.0002, 0.0001) age <- 13:49 mod1 <- Hadwiger(rate, age) mod2 <- Gama(rate, age) mod3 <- Model1(rate, age) mod4 <- Model2(rate, age)