DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Tech Hiring: Trends, Predictions, and Strategies for Success
  • Merge GraphQL Schemas Using Apollo Server and Koa
  • Alpha Testing Tutorial: A Comprehensive Guide With Best Practices
  • Knowing and Valuing Apache Kafka’s ISR (In-Sync Replicas)

Trending

  • Tech Hiring: Trends, Predictions, and Strategies for Success
  • Merge GraphQL Schemas Using Apollo Server and Koa
  • Alpha Testing Tutorial: A Comprehensive Guide With Best Practices
  • Knowing and Valuing Apache Kafka’s ISR (In-Sync Replicas)
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Estimating Age from First Name, Part 2

Estimating Age from First Name, Part 2

Matthew Dubins user avatar by
Matthew Dubins
·
Nov. 20, 13 · Interview
Like (0)
Save
Tweet
Share
6.02K Views

Join the DZone community and get the full member experience.

Join For Free

in my last post , i wrote about how i compiled a us social security agency data set into something usable in r, and mentioned some issues scaling it up to be usable for bigger datasets.  i also mentioned the need for data to test out the accuracy of my estimates.  first, i’ll show you how i prepped the dataset so that it became more scalable (for the code that got us here, see my last post):

name_data_wavgpop_unisex = ddply(name_data, .(name), function (x) sum(x$rel_pop*as.numeric(x$year))/sum(x$rel_pop))
name_data_wavgpop_unisex$v1 = round(name_data_wavgpop_unisex$v1,0)

above i’ve taken a different tactic to predicting expected year of birth according to name than i started out with in my last post. here i’m using the relative popularity of the names in each year as weights for each year value. multiplying them by the years, i get a weighted average of year that gives me predicted year of birth. then i round off the predictions to the nearest integer and continue on my way. also, because test data doesn’t seem to come packaged with gender info, i’ve constructed the weighted averages using all relative popularity values for each name, regardless of whether or not that name has been used for both sexes (a.k.a. “jordan”).

now enter the test data. i’ve discovered that the easiest way of getting real names and ages off the internet is by looking for lists of victims of some horrible tragedy. the biggest such list of victims i could find was a list of 9/11 victims . it’s not exactly formatted for easy analysis, and i was too lazy to get the data programatically, so i just copy-pasted into libreoffice calc the names and ages from the first 4 lists on the page (all from either american airlines, or united airlines) for a total of 285 observations.  i then extracted the first names, and then imported the first names and ages into r.

worldtrade = read.csv("world trade.csv")
worldtrade.ages = sqldf("select a.*, b.v1 as year from [worldtrade] as a left join name_data_wavgpop_unisex as b on a.name == b.name")
worldtrade.ages$pred.age = 2001 - as.numeric(worldtrade.ages$year)

as you can see, i opted to use sqldf to append the appropriate predicted birth years for each name on the list i imported. i then got the predicted ages by subtracting each predicted birth year from 2001. finally, let’s have a look at the resulting model fit (showing how close each predicted age was to the real age of the victim at the time of death):

predicted vs real ages for 911 victims

















as you can see, it’s not a tight prediction in the least bit.  according to model fit statistics, there’s an adjusted r-squared of 14.6% and a residual standard error of 15.58 years.  you can also see from the scatter plot that the prediction doesn’t become reasonably linear until about age 30 and onwards.  overall, i’d say it’s not too impressive, and i’d imagine it’s even worse for predicting who’s under 10 years old!

well, this was fun (if only a little disappointing). that’s statistics for you – sometimes it confirms, and sometimes it humbles you.  if you think you can show me a better way of using this name trending data to better predict ages than what i’ve done here, feel free to show me!


Test data

Published at DZone with permission of Matthew Dubins, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Tech Hiring: Trends, Predictions, and Strategies for Success
  • Merge GraphQL Schemas Using Apollo Server and Koa
  • Alpha Testing Tutorial: A Comprehensive Guide With Best Practices
  • Knowing and Valuing Apache Kafka’s ISR (In-Sync Replicas)

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: