The birth cohorts for a census represent the population born during a set interval of time. The date assigned to the time interval is the midpoint of the interval. This is generalized from the PAS spreadsheet called GRPOP-YB.

birthCohorts(Value, Age, CensusDate, cohortSize = 5)

Arguments

Value

numeric. A vector of demographic population counts by age.

Age

integer. A vector of ages corresponding to the lower integer bound of the counts.

CensusDate

date . The date of the first census. See details for ways to express it.

cohortSize

integer. The length of time (years) surrounding each output birth cohort. Default 5.

Value

A data frame with a decimal date corresponding to the midpoint of the birth cohort and resulting population counts.

Details

Age groups must be of equal intervals. No specific age structure is assumed for the census. Births are assumed to happen uniformly over the cohorts' intervals. The final age group is assumed to be the same size as all the other age groups. If cohortSize does not divide evenly into the largest age in the data, any additional (higher) ages needed are set as zero. For example, if cohortSize is 7 and the largest age is 90, then age 91 (necessary for the matrix sum) is set as zero. Dates can be given in three ways 1) a Date class object, 2) an unambiguous character string in the format "YYYY-MM-DD", or 3) as a decimal date consisting in the year plus the fraction of the year passed as of the given date.

References

United States Census Bureau (2017). “Population Analysis System (PAS) Software.” https://www.census.gov/data/software/pas.html, https://www.census.gov/data/software/pas.html.

Examples

Males <- c(18052, 16523, 15555, 12063, 9654, 9256, 10058, 10035, 9785, 9025, 7562, 6241, 5362, 4256, 3168, 1956, 1056, 568) Females <- c(17274, 15915, 14455, 11475, 9202, 9226, 10162, 10633, 9962, 9226, 7966, 6739, 5458, 4575, 3355, 2156, 1121, 636) Age <- seq(0, 85, by = 5) CensusDate <- 1950.25 birthCohorts(Males, Age, CensusDate)
#> Year Births #> 1 1947.75 18052 #> 2 1942.75 16523 #> 3 1937.75 15555 #> 4 1932.75 12063 #> 5 1927.75 9654 #> 6 1922.75 9256 #> 7 1917.75 10058 #> 8 1912.75 10035 #> 9 1907.75 9785 #> 10 1902.75 9025 #> 11 1897.75 7562 #> 12 1892.75 6241 #> 13 1887.75 5362 #> 14 1882.75 4256 #> 15 1877.75 3168 #> 16 1872.75 1956 #> 17 1867.75 1056 #> 18 1862.75 568
birthCohorts(Females, Age, CensusDate)
#> Year Births #> 1 1947.75 17274 #> 2 1942.75 15915 #> 3 1937.75 14455 #> 4 1932.75 11475 #> 5 1927.75 9202 #> 6 1922.75 9226 #> 7 1917.75 10162 #> 8 1912.75 10633 #> 9 1907.75 9962 #> 10 1902.75 9226 #> 11 1897.75 7966 #> 12 1892.75 6739 #> 13 1887.75 5458 #> 14 1882.75 4575 #> 15 1877.75 3355 #> 16 1872.75 2156 #> 17 1867.75 1121 #> 18 1862.75 636
birthCohorts(Females, Age, CensusDate, cohortSize = 10)
#> Year Births #> 1 1945.25 33189 #> 2 1935.25 25930 #> 3 1925.25 18428 #> 4 1915.25 20795 #> 5 1905.25 19188 #> 6 1895.25 14705 #> 7 1885.25 10033 #> 8 1875.25 5511 #> 9 1865.25 1757
if (FALSE) { plot(birthCohorts(Males, Age, CensusDate), col = "red", xlab = "Birth cohorts", ylab = "Births", fill =T,pch=2) points(birthCohorts(Females, Age, CensusDate), col = "blue", pch=3) legend("topleft", pch = 2:3, col = c("red","blue"), legend = c("Males","Females")) }