
Last chance! 50% off unlimited learning
Sale ends in
This is a utility function for performing BISG. It operates on a voter file, and utilizes WRU's function for calculating probability of race by surname.
compute_p_r_cond_s(
voter_file,
surname_col,
surname_counts = NULL,
surname_col_counts = "surname",
race_cols = c("whi", "bla", "his", "asi", "oth"),
impute_missing = TRUE
)
A tibble with rows denoting voters and columns denoting the probability that each voter is of a particular racial group.
A tibble containing a list of voters (by row), and a column that denotes their surname.
A string denoting which column contains the voter surname.
A dataframe denoting the frequency with which surnames correspond to different race/ethnicities. If NULL, the Census surname list is used with categories and merging functions from wru. The dataframe should contain one column with surnames (specified with the y surname_col_counts parameter) and one column for each race/ethnicity group (specified with the race_cols parameter).
A string denoting the column in the surname_counts tibble that refers to the geographic unit.
name of race columns in surname_counts
data.frame.
Boolean indicating weather to fill in missing names with mean probability across all surnames.