graduate_grabill_expand: Create the Grabill coefficient matrix.

View source: R/graduate.R

graduate_grabill_expandR Documentation

Create the Grabill coefficient matrix.

Description

The resulting coefficient matrix is based on the number of rows in popmat where we assume that each row of data is a 5-year age group and the final row is an open age group to be preserved as such.

Usage

graduate_grabill_expand(Value, Age, OAG = TRUE)

Arguments

Value

numeric vector, presumably counts in grouped ages

Age

integer vector, lower bounds of age groups

OAG

logical, default = TRUE is the final age group open?

Details

The Value vector is really just a placeholder in this case. This function is a utility called by the Grabill family of functions, where it is most convenient to just pass in the same matrix being used in those calculations to determine the layout of the coefficient matrix. Note that these coefficients do not constrain population counts to their year totals. This function is called by grabill(), which ensures matching marginals by 1) blending boundary ages into the Sprague estimated population, and 2) a second constraint on the middle age groups to enforce matching sums.

References

\insertRef

shryock1973methodsDemoTools

Examples

a5 <- as.integer(rownames(pop5_mat))
graduate_grabill_expand(pop5_mat[,1], Age = a5, OAG = TRUE)
graduate_grabill_expand(pop5_mat[,1], Age = a5, OAG = FALSE)

timriffe/DemoTools documentation built on Oct. 14, 2024, 12:53 p.m.