Giter Site home page Giter Site logo

stdlib-js / datasets-pace-boston-house-prices Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1012 KB

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

Home Page: https://github.com/stdlib-js/stdlib

License: Other

Makefile 42.49% JavaScript 57.51%
nodejs javascript stdlib node node-js datasets dataset data house housing prices value boston stats statistics linear-regression prediction

datasets-pace-boston-house-prices's Introduction

About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Boston House Prices

NPM version Build Status Coverage Status

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

Installation

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

Alternatively,

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

Usage

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

dataset()

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

var data = dataset();
/* returns
    [
        {
            'obs': 1,
            'town': 'Nahant',
            'town_id': 0,
            'tract': 2011,
            'lon': -70.955000,
            'lat': 42.255000,
            'medv': 24.00,
            'cmedv': 24.00,
            '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
        },
        ...
    ]
*/

Notes

  • The data consists of 21 attributes:

    • obs: observation number
    • town: town name
    • town_id: town identifier
    • tract: tract identifier
    • lon: longitude
    • lat: latitude
    • medv: median value of owner-occupied homes in $1000's
    • cmedv: corrected median value of owner-occupied homes in $1000's
    • 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
  • 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.

  • The dataset contains eight corrections to miscoded median values, as documented by Gilley and Pace (1996).

  • The dataset augments the original dataset from Harrison and Rubinfeld (1978) by including geo-referencing and spatial estimation for each observation.

Examples

var Plot = require( '@stdlib/plot' );
var dataset = require( '@stdlib/datasets-pace-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 ].cmedv );
}

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

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

CLI

Installation

To use as a general utility, install the CLI package globally

npm install -g @stdlib/datasets-pace-boston-house-prices-cli

Usage

Usage: pace-boston-house-prices [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --format fmt          Output format: 'csv' or 'ndjson'.

Notes

  • The CLI supports two output formats: comma-separated values (CSV) and newline-delimited JSON (NDJSON). The default output format is CSV.

Examples

$ pace-boston-house-prices

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.
  • Pace, R. Kelley, and Otis W. Gilley. 1997. "Using the Spatial Configuration of the Data to Improve Estimation." The Journal of Real Estate Finance and Economics 14 (3): 333–40. doi:10.1023/A:1007762613901.

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 © 2016-2023. The Stdlib Authors.

datasets-pace-boston-house-prices's People

Contributors

stdlib-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.