nameage: nameage

Description Usage Arguments Value Examples

Description

Estimate the age of a person based on their first name.

Usage

1
nameage(names, base_year = 2015, age_range)

Arguments

names

First names as a character vector. Names are case insensitive.

base_year

Year that the age is calculated as of.

age_range

Limit the range of possible ages that the name could come from. This could be useful if you know, for example, that the name is of an adult. If missing, all ages will be considered.

Value

Returns a data frame containing the results of predicting the age. There will be one row per name found in the babynames dataset, sorted in alphabetical order. They include the following:

name

The name for which the age has been predicted.

n

Number of people born with the name between the age range for the given reference year

n_alive

Estimate of the number of people alive with the name between the age range for the given reference year

mean, sd, q1, median, q3

The mean, standard deviation, first quartile, median, and third quartile of the age for the names for the given age range and reference year.

Examples

1
2
3
4
5
6
# age as of 2015
nameage(c("Andrew", "Aleck"), base_year = 2015)
# age as of 1990
nameage(c("Andrew", "Aleck"), base_year = 1990)
# age of adults
nameage(c("Andrew", "Aleck"), base_year = 2015, age_range = c(18, 65))

andland/nameage documentation built on May 7, 2019, 8:57 p.m.