This function fetches the suggested weight for a given CPS variable from the U.S. Census Bureau's API for a specified year.

suggested_weight(variable, year = "2023")

Arguments

variable

Character. The census variable for which the suggested weight is to be fetched.

year

Character. The year for which to fetch the data. Default is "2023". Weights don't tend to change over the years.

Value

If the variable has a suggested weight, it prints the weight. If not, a message is shown indicating that the variable does not have a suggested weight.

Examples

suggested_weight("PEMLR")
#> [1] "Suggested weight for PEMLR is PWCMPWGT"