{"id":25506446,"url":"https://github.com/datadesk/census-error-analyzer","last_synced_at":"2025-04-10T11:40:32.244Z","repository":{"id":34944973,"uuid":"192939354","full_name":"datadesk/census-error-analyzer","owner":"datadesk","description":"Analyze the margin of error in U.S. census data","archived":false,"fork":false,"pushed_at":"2023-02-23T19:47:56.000Z","size":139,"stargazers_count":18,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T10:21:26.632Z","etag":null,"topics":["census","data-journalism","journalism","mapping-la-pipeline","margin-of-error","math","news","python","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datadesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-06-20T14:55:37.000Z","updated_at":"2025-03-08T18:30:18.000Z","dependencies_parsed_at":"2022-09-04T09:00:31.693Z","dependency_job_id":"86e45dcd-e41c-4a88-8638-5a1dbcff1d98","html_url":"https://github.com/datadesk/census-error-analyzer","commit_stats":{"total_commits":38,"total_committers":3,"mean_commits":"12.666666666666666","dds":"0.13157894736842102","last_synced_commit":"0e633db2903597ea6a677cd58604b5648554ace1"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadesk%2Fcensus-error-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadesk%2Fcensus-error-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadesk%2Fcensus-error-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadesk%2Fcensus-error-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datadesk","download_url":"https://codeload.github.com/datadesk/census-error-analyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248210588,"owners_count":21065574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["census","data-journalism","journalism","mapping-la-pipeline","margin-of-error","math","news","python","statistics"],"created_at":"2025-02-19T06:42:16.956Z","updated_at":"2025-04-10T11:40:32.204Z","avatar_url":"https://github.com/datadesk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# census-error-analyzer\n\nAnalyze the margin of error in U.S. census data\n\n## Installation\n\n```bash\npipenv install census-error-analyzer\n```\n\n## Usage\n\nImport the library.\n\n```python\nimport census_error_analyzer\n```\n\n### Test statistical difference\n\nAre 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`.\n\nAccepts two lists, each expected to be a pair with a value and its margin of error.\n\n```python\nus_medianage, us_medianage_moe = 37.9, 0.1\nnyc_medianage, nyc_medianage_moe = 38.4, 0.1\ncensus_error_analyzer.is_statistically_different(\n    (us_medianage, us_medianage_moe), (nyc_medianage, nyc_medianage_moe)\n)\nTrue\n```\n\nThe precise difference can also be accessed. According to the Census Bureau, values greater than 1.0 can be considered to be statistically significant.\n\n```python\ncensus_error_analyzer.statistical_difference(\n    (us_medianage, us_medianage_moe), (nyc_medianage, nyc_medianage_moe)\n)\n3.535533905932737\n```\n\n### Get statistical range\n\nThe 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.\n\n```python\ncensus_error_analyzer.statistical_range(us_medianage, us_medianage_moe)\n37.8, 38.0\n```\n\n### Convert to alternative confidence levels\n\nThe 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.\n\n```python\ncensus_error_analyzer.convert_to_95_percent_confidence(3778)\n4501.446808510638\ncensus_error_analyzer.convert_to_99_percent_confidence(3778)\n5925.373860182372\n```\n\n## References\n\nThis module was designed to conform with the Census Bureau's April 18, 2018, presentation [\"Using American Community Survey Estimates and Margin of Error.\"](https://www.documentcloud.org/documents/6162551-20180418-MOE.html)\n\nPrior to publication, the code was reviewed by Brian Dumbacher, a mathematical statistician in the U.S. Census Bureau's Economic Statistical Methods Division.\n\n## Links\n\n* Issues: [github.com/datadesk/census-error-analyzer/issues](https://github.com/datadesk/census-error-analyzer/issues)\n* Packaging: [pypi.python.org/pypi/census-error-analyzer](https://pypi.python.org/pypi/census-error-analyzer)\n* Testing: [github.com/datadesk/census-error-analyzer/actions](https://github.com/datadesk/census-error-analyzer/actions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadesk%2Fcensus-error-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadesk%2Fcensus-error-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadesk%2Fcensus-error-analyzer/lists"}