Aggregates the male and female birth-certificate counts for the supplied name tokens and returns the majority gender together with its confidence.
Arguments
- x
A
data.tableof census data as returned byget_census_data(), containing themale_valueandfemale_valuecolumns.
Value
A character vector of length two: the inferred gender code ("M",
"F", or "U" when no counts are available) and the confidence percentage
for that call. When gender is unknown only "U" is returned.
Examples
x <- "livingston III, Mr. MICHAEL JOHN9"
x <- prep_name(x)
x <- strsplit(x, " ")[[1]]
cd <- get_census_data(x)
determine_gender(cd)
#> [1] "M" "99.6"