npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@stdlib/datasets-harrison-boston-house-prices

v0.2.2

Published

A dataset derived from information collected by the US Census Service concerning housing in Boston, Massachusetts (1978).

Downloads

30

Readme

Boston House Prices

NPM version Build Status Coverage Status

A dataset derived from information collected by the US Census Service concerning housing in Boston, Massachusetts (1978).

Installation

npm install @stdlib/datasets-harrison-boston-house-prices

Usage

var dataset = require( '@stdlib/datasets-harrison-boston-house-prices' );

dataset()

Returns a dataset derived from information collected by the US Census Service concerning housing in Boston, Massachusetts (1978).

var data = dataset();
/* returns
    [
        {
            'crim': 0.00632,
            'zn': 18.00,
            'indus': 2.310,
            'chas': 0,
            'nox': 0.5380,
            'rm': 6.5750,
            'age': 65.20,
            'dis': 4.0900,
            'rad': 1,
            'tax': 296.0,
            'ptratio': 15.30,
            'b': 396.90,
            'lstat': 4.98,
            'medv': 24.00
        },
        ...
    ]
*/

Notes

  • The data consists of 14 attributes:

    • crim: per capita crime rate by town
    • zn: proportion of residential land zoned for lots over 25,000 square feet
    • indus: proportion of non-retail business acres per town
    • chas: Charles River dummy variable (1 if tract bounds river; 0 otherwise)
    • nox: nitric oxides concentration (parts per 10 million)
    • rm: average number of rooms per dwelling
    • age: proportion of owner-occupied units built prior to 1940
    • dis: weighted distances to five Boston employment centers
    • rad: index of accessibility to radial highways
    • tax: full-value property-tax rate per $10,000
    • ptratio: pupil-teacher ratio by town
    • b: 1000(Bk-0.63)^2 where Bk is the proportion of blacks by town
    • lstat: percent lower status of the population
    • medv: median value of owner-occupied homes in $1000's
  • The dataset can be used to predict two dependent variables: 1) nitrous oxide level and 2) median home value.

  • The median home value field seems to be censored at 50.00 (corresponding to a median value of $50,000). Censoring is suggested by the fact that the highest median value of exactly $50,000 is reported in 16 cases, while 15 cases have values between $40,000 and $50,000. Values are rounded to the nearest hundred. Harrison and Rubinfeld do not, however, mention any censoring.

  • As documented by Gilley and Pace (1996), the dataset contains eight miscoded median values.

Examples

var Plot = require( '@stdlib/plot' );
var dataset = require( '@stdlib/datasets-harrison-boston-house-prices' );

var data;
var plot;
var opts;
var x;
var y;
var i;

data = dataset();

// Extract housing data...
x = [];
y = [];
for ( i = 0; i < data.length; i++ ) {
    x.push( data[ i ].rm );
    y.push( data[ i ].medv );
}

// Create a plot instance:
opts = {
    'lineStyle': 'none',
    'symbols': 'closed-circle',
    'xLabel': 'Average Number of Rooms',
    'yLabel': 'Median Value',
    'title': 'Number of Rooms vs Median Value'
};
plot = new Plot( [ x ], [ y ], opts );

// Render the plot:
console.log( plot.render( 'html' ) );

References

  • Harrison, David, and Daniel L Rubinfeld. 1978. "Hedonic housing prices and the demand for clean air." Journal of Environmental Economics and Management 5 (1): 81–102. doi:10.1016/0095-0696(78)90006-2.
  • Gilley, Otis W., and R.Kelley Pace. 1996. "On the Harrison and Rubinfeld Data." Journal of Environmental Economics and Management 31 (3): 403–5. doi:10.1006/jeem.1996.0052.

License

The data files (databases) are licensed under an Open Data Commons Public Domain Dedication & License 1.0 and their contents are licensed under a Creative Commons Zero v1.0 Universal. The software is licensed under Apache License, Version 2.0.

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


Copyright

Copyright © 2016-2024. The Stdlib Authors.