datasets-io / male-first-names-us-frequency

Historical frequency of male first names in the population of U.S. births.
MIT License
3 stars 1 forks source link

Frequencies of Male First Names

NPM version Build Status Coverage Status Dependencies

Data on the historical frequency of male first names in the population of U.S. births.

Installation

$ npm install datasets-male-first-names-us-frequency

Usage

var data = require( 'datasets-male-first-names-us-frequency' );

data

A data object with keys corresponding to all the names given to male children born in the United States in the period from 1880-2014. All names are in lower-case letters. For each name, an array-of-arrays is exported with birth frequencies for each year. For years in which less than five children with a certain name were born, no data is available.

// Retrieve data for the name "Kaden"
data.kaden
/*
    [
        [1977,5],
        [1980,5],
        [1982,6],
        (...),
        [2012,2939],
        [2013,2617],
        [2014,2440]
    ]
*/

Reference

The original data was collected by the Social Security Administration and is based on Social Security card applications for births that occurred in the United States after 1879. Since this data is based on government documents, it should be considered public domain.

Examples

// Frequencies for name `Herbert`
var freq,
    i;

freq = require('datasets-male-first-names-us-frequency/lib/herbert.json' );

for( i = 0; i < freq.length; i++ ) {
    console.log( 'Year: ' + freq[ i ][ 0 ] + '; Count: ' + freq[ i ][ 1 ] );
}

To run the example code from the top-level application directory,

$ node ./examples/index.js

Tests

Unit

Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:

$ make test

All new feature development should have corresponding unit tests to validate correct functionality.

Test Coverage

This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

$ make test-cov

Istanbul creates a ./reports/coverage directory. To access an HTML version of the report,

$ make view-cov

License

MIT license.

Copyright

Copyright © 2015. The Compute.io Authors.