This function reproduces calculations of CENSUR~3.XLS by Griff Feeney. Censuses are assumed to be spaced 5 years apart and population counts for both censuses in 5-year age groups. The staggered ratio of these approximates lifetable function npx =1-nqx, i.e. probability of surviving between age x and age x+n. The cumulative product of this approximates the survival function lx.

surv5(pop1, pop2)

Arguments

pop1

numeric. Vector of population counts in 5-year age groups of census 1.

pop2

numeric. Vector of population counts in 5-year age groups of census 2.

Value

Survival function lx as a numeric vector with radix 1.

Details

Checking for census spacing of 5 years must happen prior to this function. Also, we assume the open age group has already been trimmed off.

Examples

# 1965 vs 1970 pops pop1 <- c(3983902,3854281,4513237,5373547,4572392,4206801,4110076,3751030, 3231736,2697217,2485095,2071540,1719370,1343444,955567,644043,341170) pop2 <- c(4292503,3988292,3852101,4492096,5347327,4571868,4190340,4085338, 3674127,3198934,2648360,2382691,1970485,1584699,1172155,736258,408191) surv5(pop1,pop2)
#> [1] 1.0000000 1.0011019 1.0005357 0.9958490 0.9909898 0.9908762 0.9869990 #> [8] 0.9810583 0.9609448 0.9511913 0.9339615 0.8954755 0.8517920 0.7850747 #> [15] 0.6849777 0.5277708 0.3344983
if (FALSE) { plot(seq(0,80,5),surv5(pop1,pop2), t ='l', col='red', ylim = c(0,1), ylab = 'Survival function', xlab = 'Age') }