Description Usage Arguments Details Value Examples
race.pred makes probabilistic estimates of individual-level race/ethnicity.
1 2 3  | 
voters | 
 An object of class   | 
races | 
 A character vector specifying which racial groups to generate
predicted probabilities for. Can include any subset of the default vector,
which is   | 
name.clean | 
 A   | 
surname.only | 
 A   | 
census | 
 An optional character vector specifying what level of
geography to use to merge in U.S. Census 2010 data. Currently only
  | 
census.key | 
 A character object specifying user's Census API
key. Must be specified if   | 
demo | 
 An optional   | 
party | 
 An optional character object specifying party registration field. Party registration should be coded as 1 for Democrat, 2 for Republican, and 0 for Other.  | 
This function implements the Bayesian race prediction methods outlined in Imai and Khanna (2015). The function produces probabilistics estimates of individual-level race/ethnicity, based on surname, geolocation, and party.
Output will be an object of class data.frame. It will
consist of the original user-input data with additional columns that
contain predicted probabilities for each race in races.
1 2 3 4 5 6 7 8  | data(voters)
race.pred(voters = voters, races = c("asian"), surname.only = TRUE)
## Not run: race.pred(voters = voters, races = c("white", "black", "latino"),
census = "tract", census.key = "...", demo = TRUE)
## End(Not run)
## Not run: race.pred(voters = voters, races = c("white", "black", "latino", "asian", "other"),
census = "tract", census.key = "...", party = "PID")
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.