graduate_sprague_expand: Create the Sprague coefficient matrix.

View source: R/graduate.R

graduate_sprague_expandR Documentation

Create the Sprague coefficient matrix.

Description

The resulting coefficient matrix is based on the number of rows in popmat where is assumed that each row of data is a 5-year age group. The final row may be an open or closed age group, as indicated by the OAG argument.

Usage

graduate_sprague_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 popmat matrix is really just a placeholder in this case. This function is a utility called by the Sprague 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.

References

\insertRef

sprague1880explanationDemoTools \insertRefshryock1973methodsDemoTools \insertRefsiegel2004methodsDemoTools

Examples

a5           <- as.integer(rownames(pop5_mat))
coefsOA      <- graduate_sprague_expand(pop5_mat[,1], Age = a5, OAG = TRUE)
coefsclosed  <- graduate_sprague_expand(pop5_mat[,1], Age = a5, OAG = FALSE)
dim(coefsOA)
dim(coefsclosed)

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