View source: R/impute_ethnorace.R
impute_ethnorace | R Documentation |
Calculates posterior probabilities for individual ethnorace categories using the Naive Bayes algorithm. Also returns highest probability ethnorace as a new character column in the data frame.
impute_ethnorace(input_data, bper_data = NULL, year, census_key, ...)
input_data |
The input data frame containing the individuals whose
ethnorace the user wants to impute. The following input variables are
supported: |
bper_data |
The data list containing ethnorace conditional
probabilities. If left empty, will default to downloading directly from
Census API. Use the function |
year |
The year for which Census data will be loaded. The function will retrieve the closest available Census data for the year. |
census_key |
Personal Census API key. See https://api.census.gov/data/key_signup.html |
The original data frame with the additional columns for ethnorace probabilities and highest probability imputed category.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.