race_wru | R Documentation |
Wrapper around wru::predict_race()
race_wru(
.tab,
.use_geo = FALSE,
.use_age = FALSE,
.use_gen = FALSE,
.census_dir = NULL,
.census_geo = ""
)
.tab |
Input Table, must contain at least 2 columns: |
.use_geo |
Should race be inferred from geo location (Logical: TRUE/FALSE, Default: FALSE)? |
.use_age |
Should race be inferred from information about a persons birth year (Logical: TRUE/FALSE, Default: FALSE)? |
.use_gen |
Should race be inferred from information about a persons gender (Logical: TRUE/FALSE, Default: FALSE)? |
.census_dir |
Directory to save Census Data (can be reused) |
.census_geo |
Either "county", "tract", "block", or "place" |
The column 'method' encodes several variables at one and is encoded in the following way:
package-first name used-last name used-geo loaction used-age used-gender used-geo location
For example: The method WRU-0-1-1-1-1-C means that the package WRU is used, prediction is not based on the first name,
predictio is based on the last name, geo location is used, age is used, gender is used, and the geo location is a COunty (C)
The original data frame (.tab in long format) appended with the following columns:
method: Used methods (see details for more information)
pasian: Probability of the person being asian
pblack: Probability of the person being black
phispa: Probability of the person being hispanic
pwhite: Probability of the person being white
pother: Probability of the person being non of the above races
race: The most likely race as predicted by the respective method
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.