Who are You? Bayesian Prediction of Racial Category Using Surname, First Name, Middle Name, and Geolocation
Overview
Predicts individual race/ethnicity using surname, first name, middle name, geolocation, and other attributes, such as gender and age. The method utilizes Bayes' Rule (with optional measurement error correction) to compute the posterior probability of each racial category for any given individual. The package implements methods described in Imai and Khanna (2016) "Improving Ecological Inference by Predicting Individual Ethnicity from Voter Registration Records" Political Analysis DOI:10.1093/pan/mpw001 and Imai, Olivella, and Rosenman (2022) "Addressing census data problems in race imputation via fully Bayesian Improved Surname Geocoding and name supplements" DOI:10.1126/sciadv.adc9824. The package also incorporates the data described in Rosenman, Olivella, and Imai (2023) "Race and ethnicity data for first, middle, and surnames" DOI:10.1038/s41597-023-02202-2.
Install
Health
- OK13 OK2026-10-14
- ERROR12 OK, 1 ERROR2026-10-12
- OK13 OK2026-09-23
- ERROR12 OK, 1 ERROR2026-09-19
- OK13 OK2026-08-04
Show 10 earlier changesHide 10 earlier changes
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- WARNING12 OK, 1 WARNING2026-06-07
- OK13 OK2026-05-08
- NOTE11 OK, 2 NOTE2026-04-29
- ERROR10 OK, 2 NOTE, 1 ERROR2026-04-28
- NOTE9 OK, 5 NOTE2026-04-22
- ERROR8 OK, 5 NOTE, 1 ERROR2026-04-18
- NOTE9 OK, 5 NOTE2026-03-10
Documentation
- Help pages
- 32 (22 internal)
- Examples that run
- 40%6 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran) · 8 never run
- Exported functions with examples
- 80%
- Documented parameters
- 100%
- Return-value docs
- 60%
- Help pages citing references
- 13%
Downloads
Repository
- PRs merged (all time)
- 76%
- Median days to close, 50 most recently updated closed issues
- 17
- Median days to close, 50 most recently updated closed PRs
- 2
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
6 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/kosukeimai/wru on 2026-10-25.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 1 practice
Dependencies
Installing wru adds 65 packages (38 with compiled code, 45 MB of source tarballs). Heaviest: stringi 11 MB, sf 9.3 MB, s2 2.8 MB.
Code & Tests
Datasets
People & History
Previously maintained by Kabir Khanna (0.0-1 to 0.1-12).
Pick two releases to compare their code metrics.
- 3.1.0Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 3.0.32024-05-24 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 3.0.22024-04-04 · diff ↗
- 3.0.12024-02-28 · diff ↗
- 3.0.0
- RR 4.3.0 released · 2023-04-21
- 1.0.12022-10-21 · diff ↗
- 1.0.02022-06-21 · diff ↗ ·
removed 6 exports
census_geo_api, census_helper, get_census_api, get_census_api_2, merge_surnames, vec_to_chunkadded 1 export
format_legacy_data - RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.1-122021-05-17 · diff ↗
- 0.1-112021-04-22 · diff ↗
- 0.1-102020-10-22 · diff ↗
Show 17 earlier eventsHide 17 earlier events
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- 0.1-92019-02-21 · diff ↗
- 0.1-82019-02-13 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 0.1-72017-09-01 · diff ↗
- 0.1-62017-08-17 · diff ↗
- 0.1-52017-06-09 · diff ↗
- 0.1-42017-05-05 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 0.1-32017-04-14 · diff ↗
- 0.1-22017-03-05 · diff ↗ ·
removed 10 exports
census.helper.api, census.helper.api.local, census.helper.api.online, censusData, getCensusApi, getCensusApi2, getCensusData, name.clean, race.pred, vecToChunkadded 8 exports
census_geo_api, census_helper, get_census_api, get_census_api_2, get_census_data, merge_surnames, predict_race, vec_to_chunk - 0.1-12016-12-13 · diff ↗ ·
added 4 exports
census.helper.api.local, census.helper.api.online, censusData, getCensusData - RR 3.3.0 released · 2016-05-03
- 0.0-22016-03-11 · diff ↗
- 0.0-12015-12-09
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-12-09
- Total releases
- 21 / 11 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 3.4 MB / 4 files
- Download size
- 4.4 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("wru")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.