OPAG_nLx_warp_r | R Documentation |
We take nLx
as indicative of a stationary population age structure,
then subject the population structure to long-term growth by a constant rate, r
.
OPAG_nLx_warp_r(Lx1, Age_Lx1, r)
Lx1 |
numeric vector of stationary population age structure in arbitrary integer age groups |
Age_Lx1 |
integer vector of lower bounds of age groups of |
r |
stable growth rate |
Lx1
could be any population structure of any scale, as long as you're comfortable
assuming it's stationary and can be warped into stable. For the oldest ages, this is probably
quite often an acceptable and useful approximation. The transformation is applied at the single-age scale, even if the input nLx
is in wider (e.g. abridged) age groups. When needed, we reduce to single ages using (default) graduate_uniform()
, then apply the transformation, then group back. This is innocuous if nLx
is given in single ages. You may want to change method
to "mono"
or "pclm"
.
numeric vector of the transformed nLx
. Note, this vector sums to 1
.
Lx <- downloadnLx(NULL, "Spain","female",1971)
Age <- names2age(Lx)
r <- .01
ai <- age2int(Age)
## Not run:
plot(Age, Lx/sum(Lx) / ai, type = 's',ylim = c(0,0.015))
lines(Age,OPAG_nLx_warp_r(Lx,Age,0.005)/ai,type='s',col = "red")
lines(Age,OPAG_nLx_warp_r(Lx,Age,-0.005)/ai,type='s',col = "blue")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.