OPAG | R Documentation |
This can be used as an external check of population counts
in older ages, assuming the stable population standard is representative enough, or it can be used to redistribute population in ages above a
specified ages Redistribute_from
. This is handy, for instance, for
ensuring all censuses extend to a specified maximum age (e.g. 100+)
prior to intercensal interpolations. The assumption is that, at least in
ages including Age_fit
and higher ages, the population should follow
a stable pattern proportional to a given survival curve subject to
constant growth, r
.
OPAG(
Pop,
Age_Pop,
nLx,
Age_nLx,
Age_fit = NULL,
AgeInt_fit = NULL,
Redistribute_from = max(Age_Pop),
OAnew = max(Age_nLx),
method = "mono"
)
Pop |
numeric vector of population counts |
Age_Pop |
integer vector of the lower bounds of the population age groups |
nLx |
numeric vector of stationary population age structure in arbitrary integer age groups |
Age_nLx |
integer vector of lower bounds of age groups of |
Age_fit |
integer vector of lower bounds for age groups of |
AgeInt_fit |
integer vector of widths of age groups of |
Redistribute_from |
integer lower age bound that forms the cutoff, above which we redistribute counts using the stable standard. |
OAnew |
integer. Desired open age group in the output (must being element of |
method |
character, graduation method used for intermediate graduation. Default |
It may be helpful to try more than one fitting possibility,
and more than one Redistribute_from
cut point, as results may vary.
Redistribute_from
can be lower than your current open age group,
and OAnew
can be higher, as long as it is within the range of Age_nLx
.
If Age_nLx
doesn't go high enough for your needs, you can extrapolate
it ahead of time. For this, you'd want the nMx
the underlie it, and you
can use lt_abridged()
, specifying a higher open age, and then
extracting nLx
again from it.
# India Males, 1971
Pop <- smooth_age_5(pop1m_ind,
Age = 0:100,
method = "Arriaga")
Age_Pop <- names2age(Pop)
AgeInt_Pop <- age2int(Age_Pop, OAvalue = 1)
nLx <- downloadnLx(NULL, "India","male",1971)
Age_nLx <- names2age(nLx)
AgeInt_nLx <- age2int(Age_nLx, OAvalue = 1)
Pop_fit <- OPAG(Pop,
Age_Pop = Age_Pop,
nLx = nLx,
Age_nLx = Age_nLx,
Age_fit = c(60,70),
AgeInt_fit = c(10,10),
Redistribute_from = 80)
## Not run:
# look at 75+
ind <- Age_Pop >= 75
plot(Age_Pop[ind], Pop[ind])
lines(Age_Pop[ind], Pop_fit$Pop_out[ind], col = "blue")
# relative differences in ages 80+
ind <- Age_Pop >= 80
plot(Age_Pop[ind], (Pop_fit$Pop_out[ind] - Pop[ind]) / Pop[ind])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.