Learn R Programming

qdap (version 0.2.5)

name2sex: Names to Gender Prediction

Description

Predict gender from U.S. names (based on 1990 U.S. census data).

Usage

name2sex(names.list, pred.sex = TRUE,
    fuzzy.match = pred.sex, USE.NAMES = FALSE)

Arguments

names.list
Character vector containing first names.
pred.sex
logical. If TRUE overlapping M/F names will be predicted based on highest cummulative frequency. If FALSE the overlapping names will be denoted with a "B".
fuzzy.match
ligical. If TRUE uses Levenshtein edit distance from agrep to predict gender from the closest name match starting with the same letter. This is computationally intensive and sho
USE.NAMES
logical. If TRUE names.list is used to name the gender vector.

Value

  • Returns a vector of predicted gender (M/F) based on first name.

References

http://www.census.gov/genealogy/www/data/1990surnames/names_files.html http://stackoverflow.com/a/818231/1000343 http://www.talkstats.com/showthread.php/31660

See Also

agrep

Examples

Run this code
name2sex(qcv(mary, jenn, linda, JAME, GABRIEL, OLIVA,
    tyler, jamie, JAMES, tyrone, cheryl, drew))

name2sex(qcv(mary, jenn, linda, JAME, GABRIEL, OLIVA,
    tyler, jamie, JAMES, tyrone, cheryl, drew), FALSE)

name2sex(qcv(mary, jenn, linda, JAME, GABRIEL, OLIVA,
    tyler, jamie, JAMES, tyrone, cheryl, drew), FALSE, TRUE)

name2sex(qcv(mary, jenn, linda, JAME, GABRIEL, OLIVA,
    tyler, jamie, JAMES, tyrone, cheryl, drew), TRUE, FALSE)

Run the code above in your browser using DataLab