Description Usage Arguments Value Examples
This function predicts the gender of a first name given a year or range of
years in which the person was born. The prediction can use one of several
data sets suitable for different time periods or geographical regions. See
the package vignette for suggestions on using this function with multiple
names and for a discussion of which data set is most suitable for your
research question. When using certain methods, the genderdata
data
package is required; you will be prompted to install it if it is not already
available.
1 2 3 4 5 6 7 |
names |
First names as a character vector. Names are case insensitive. |
years |
The birth year of the name whose gender is to be predicted. This
argument can be either a single year, a range of years in the form
|
method |
This value determines the data set that is used to predict the
gender of the name. The |
countries |
The countries for which datasets are being used. For the
|
Returns a data frame containing the results of predicting the gender. The exact components of the returned list will depend on the specific method used. They include the following:
name |
The name for which the gender has been predicted. |
proportion_male |
The proportion of male names for the given range of years. |
proportion_female |
The proportion of female names for the given range of years. |
gender |
The
predicted gender based on the proportion of male and female names. Possible
values are |
year_min |
The lower bound (inclusive) of the year range used for the prediction. |
year_max |
The upper bound (inclusive) of the year range used for the prediction. |
1 2 3 4 5 6 7 8 | gender("madison", method = "demo", years = 1985)
gender("madison", method = "demo", years = c(1900, 1985))
# SSA method
## Not run: gender("madison", method = "demo", years = c(1900, 1985))
# IPUMS method
## Not run: gender("madison", method = "ipums", years = 1860)
# NAPP method
## Not run: gender("madison", method = "napp", countries = c("Sweden", "Denmark"))
|
# A tibble: 1 x 6
name proportion_male proportion_female gender year_min year_max
<chr> <dbl> <dbl> <chr> <dbl> <dbl>
1 madison 0.2137 0.7863 female 1985 1985
# A tibble: 1 x 6
name proportion_male proportion_female gender year_min year_max
<chr> <dbl> <dbl> <chr> <dbl> <dbl>
1 madison 0.9028 0.0972 male 1900 1985
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.