Skip to main content

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.

Metadata

Release files for census-error-analyzer 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for census-error-analyzer 0.0.5
File Size Uploaded
census-error-analyzer-0.0.5.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for census-error-analyzer 0.0.5
File Interpreter ABI Platform
census_error_analyzer-0.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 26.3 kB

Release files / census-error-analyzer-0.0.5.tar.gz

Download URL census-error-analyzer-0.0.5.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5d064f5e33b516979d146727eec83ff3795695cc37976fd12cfcf96826a84008
BLAKE2b-256 checksum
How to use checksums
df4681bbfe352c01a2f6ff7512cdd932cf6242d6df6b2580633da60d281994cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / census_error_analyzer-0.0.5-py2.py3-none-any.whl

Download URL census_error_analyzer-0.0.5-py2.py3-none-any.whl
Size 4.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8402491dde23efede9895b0eeb2a4fc6d836c475d49587497e0897691a81b6b3
BLAKE2b-256 checksum
How to use checksums
a9a278d4e9c47cfc0e8ceb9a8b34dd606220e9de5d81093095560566c127ea04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page