predictrace
Predict the Race of a Given Surname Using Census Data
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
Predict the Race of a Given Surname Using Census Data
Basic Info
- Host: GitHub
- Owner: jacobkap
- License: other
- Language: R
- Default Branch: master
- Homepage: https://jacobkap.github.io/predictrace/
- Size: 42.7 MB
Statistics
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Created almost 10 years ago
· Last pushed about 3 years ago
Metadata Files
Readme
License
README.Rmd
---
output: github_document
---
[](https://cran.r-project.org/package=predictrace)
[](https://ci.appveyor.com/project/jacobkap/predictrace)
[](https://app.codecov.io/github/jacobkap/predictrace?branch=master)
[](https://cran.r-project.org/package=predictrace)
## Overview
The goal of `predictrace` is to predict the race of a surname or first name and the gender of a first name. This package uses U.S. Census data which says how many people of each race has a certain surname. For first name data, this package uses data from Tzioumis (2018). From this we can predict which race is mostly likely to have that surname or first name. The possible races are American Indian, Asian, Black, Hispanic, White, or two or more races. For the gender of first names, this package uses data from the United States Social Security Administration (SSA) that tells how many people of a given name are female and how many are male (no other genders are included). I use this to determine the proportion of each gender a name is, and use the gender with the higher proportion as the most likely gender for that name. Please note that the Census data on the race of first names is far smaller than the SSA data on the gender of first names, so you will match far fewer first names to race than to gender.
Full citation for the Tzioumis data: Tzioumis, Konstantinos (2018) Demographic aspects of first names, Scientific Data, 5:180025 [dx.doi.org/10.1038/sdata.2018.25].
## Installation
```{r, eval = FALSE}
To install this package, use the code
install.packages("predictrace")
# The development version is available on Github.
# install.packages("devtools")
devtools::install_github("jacobkap/predictrace")
```
## Usage
```{r}
library(predictrace)
```
### Race of a surname
To get the race of a surname, the only required parameter in `predict_race()` is `name` which is the surname you want to find the race of. Please note that this parameter only accepts surnames, including both first and last name will result in not finding a match in the Census data. This function returns the name you input, the named matched through Census data, and likely race of that name, and the probability that the name is of each race.
```{r}
predict_race("Washington")
```
This function accepts a single string or a vector of strings.
```{r}
predict_race(c("Washington", "Franklin", "Lincoln"))
```
If you only want the most likely race and not the individual probabilities of each race, set the parameter `probability` to FALSE.
```{r}
predict_race("Washington", probability = FALSE)
```
### Race of a first name
To get the race of a first name, you again use `predict_race()` but now set the parameter `surname` to FALSE. This returns the exact same results as above, but now only works for first names (you may still get a match of a name if you don't set the parameter to FALSE but that is simply because some first names are also last names. The race results will likely be incorrect.).
```{r}
predict_race("sarah", surname = FALSE)
```
This function accepts a single string or a vector of strings.
```{r}
predict_race(c("sarah", "jaime", "jon", "bao"), surname = FALSE)
```
If you only want the most likely race and not the individual probabilities of each race, set the parameter `probability` to FALSE.
```{r}
predict_race("sarah", probability = FALSE, surname = FALSE)
```
### Gender of a first name
To get the gender of a first name you use the `predict_gender()` function and the only required parameter in `predict_gender()` is `name` which is the first name you want to find the gender of. This function returns the name you input, the named matched through SSA data, and likely gender of that name, and the probability that the name is female or male.
```{r}
predict_gender("tyrion")
```
```{r}
predict_gender(c("tyrion", "jaime", "jon", "sansa", "arya", "cersei"))
```
If you only want the most likely gender and not the individual probabilities of each gender, set the parameter `probability` to FALSE.
```{r}
predict_gender(c("tyrion", "jaime", "jon", "sansa", "arya", "cersei"), probability = FALSE)
```
In cases where there is no match in the data, it will return NA.
```{r}
predict_gender("zzztyrion")
```
Owner
- Name: Jacob Kaplan
- Login: jacobkap
- Kind: user
- Website: http://jacobdkaplan.com/
- Repositories: 8
- Profile: https://github.com/jacobkap
GitHub Events
Total
Last Year
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 24
- Total Committers: 2
- Avg Commits per committer: 12.0
- Development Distribution Score (DDS): 0.417
Top Committers
| Name | Commits | |
|---|---|---|
| jacobkap | j****p@s****u | 14 |
| Your name | e****s@g****m | 10 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 2 years ago
All Time
- Total issues: 3
- Total pull requests: 0
- Average time to close issues: 3 days
- Average time to close pull requests: N/A
- Total issue authors: 3
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: 44 minutes
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 2.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mrhumanzee (1)
- Charlottelqx (1)
- jmrphy (1)
Pull Request Authors
Top Labels
Issue Labels
bug (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 284 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: predictrace
Predict the Race and Gender of a Given Name Using Census and Social Security Administration Data
- Homepage: https://github.com/jacobkap/predictrace
- Documentation: http://cran.r-project.org/web/packages/predictrace/predictrace.pdf
- License: MIT + file LICENSE
-
Latest release: 2.0.1
published about 3 years ago
Rankings
Stargazers count: 19.8%
Forks count: 28.8%
Dependent packages count: 29.8%
Average: 32.4%
Dependent repos count: 35.5%
Downloads: 48.1%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 2.10 depends
- dplyr * imports
- covr * suggests
- knitr * suggests
- rmarkdown * suggests
- spelling * suggests
- testthat >= 2.1.0 suggests