Giter VIP home page Giter VIP logo

census-error-analyzer's Introduction

census-error-analyzer

Analyze the margin of error in U.S. census data

Installation

pipenv install census-error-analyzer

Usage

Import the library.

import census_error_analyzer

Test statistical difference

Are two values, considering their respective margins of error, statistically different? The Census Bureau advises that this test be conducted for all comparisons. This test answers the question and returns True or False.

Accepts two lists, each expected to be a pair with a value and its margin of error.

us_medianage, us_medianage_moe = 37.9, 0.1
nyc_medianage, nyc_medianage_moe = 38.4, 0.1
census_error_analyzer.is_statistically_different(
    (us_medianage, us_medianage_moe), (nyc_medianage, nyc_medianage_moe)
)
True

The precise difference can also be accessed. According to the Census Bureau, values greater than 1.0 can be considered to be statistically significant.

census_error_analyzer.statistical_difference(
    (us_medianage, us_medianage_moe), (nyc_medianage, nyc_medianage_moe)
)
3.535533905932737

Get statistical range

The minimum and maximum values in an estimate's statistical range given its margin of error. Expects two arguments: The estimate first. The margin of error second.

census_error_analyzer.statistical_range(us_medianage, us_medianage_moe)
37.8, 38.0

Convert to alternative confidence levels

The margins of error published by the Census are at the 90% confidence level. They can be converted to the 95% and 99% levels using tools in this library.

census_error_analyzer.convert_to_95_percent_confidence(3778)
4501.446808510638
census_error_analyzer.convert_to_99_percent_confidence(3778)
5925.373860182372

References

This module was designed to conform with the Census Bureau's April 18, 2018, presentation "Using American Community Survey Estimates and Margin of Error."

Prior to publication, the code was reviewed by Brian Dumbacher, a mathematical statistician in the U.S. Census Bureau's Economic Statistical Methods Division.

Links

census-error-analyzer's People

Contributors

dependabot[bot] avatar palewire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

census-error-analyzer's Issues

A "statistical difference" test

Evaluates whether the difference between two values, considering their respectively margins of errors, is statistically significant.

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.