pias_class: Make a PIAS for elementary aggregates in a classification

Description Usage Arguments Details Value See Also Examples

View source: R/estimation.R

Description

Make a list that gives the aggregation structure for EAs in a classification in which each digits of the classification corresponds to a level of aggregation (like NAICS or NAPCS).

Usage

1

Arguments

x

A vector of classifications for elementary aggregates (e.g., 6 digit NAICS).

Details

This function takes the elements of x and makes a list that groups each element by all left-to-right combinations of all but the last characters in x. For example, if x is a vector all 4-digits NAICS, then the result will be a list that groups each 4-digit NAICS into 3-digit, 2-digit, and 1-digit NAICS.

Value

A list.

See Also

See pias_matrix for turning a classification into an aggregation structure.

Examples

1
2
3
4
5
6
7
8
9
eas <- c('111', '112', '121', '122', '123')
pias_class(eas)

# Make some weights
w <- runif(5)
names(w) <- eas

# Make a PIAS matrix
pm <- pias_matrix(pias_class(eas), w)

marberts/ppd documentation built on March 27, 2020, 7:21 p.m.