{"id":50978513,"url":"https://github.com/dgraves4/cms-hospital-quality-analytics","last_synced_at":"2026-06-19T11:31:18.336Z","repository":{"id":362349367,"uuid":"1258624823","full_name":"dgraves4/cms-hospital-quality-analytics","owner":"dgraves4","description":"Python analytics project using CMS hospital quality data to clean, summarize, and visualize hospital ratings, reporting patterns, and facility characteristics.","archived":false,"fork":false,"pushed_at":"2026-06-03T20:02:58.000Z","size":482,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-03T21:14:01.543Z","etag":null,"topics":["cms-data","data-analysis","eda","healthcare-analytics","matplotlib","pandas","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgraves4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-03T18:58:58.000Z","updated_at":"2026-06-03T20:03:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dgraves4/cms-hospital-quality-analytics","commit_stats":null,"previous_names":["dgraves4/cms-hospital-quality-analytics"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dgraves4/cms-hospital-quality-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraves4%2Fcms-hospital-quality-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraves4%2Fcms-hospital-quality-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraves4%2Fcms-hospital-quality-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraves4%2Fcms-hospital-quality-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgraves4","download_url":"https://codeload.github.com/dgraves4/cms-hospital-quality-analytics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgraves4%2Fcms-hospital-quality-analytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34530297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cms-data","data-analysis","eda","healthcare-analytics","matplotlib","pandas","python"],"created_at":"2026-06-19T11:31:13.830Z","updated_at":"2026-06-19T11:31:18.306Z","avatar_url":"https://github.com/dgraves4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMS Hospital Quality Analytics\n\n## Project Overview\n\nThis project analyzes CMS hospital quality data to explore hospital characteristics, overall ratings, missing quality-measure reporting, and differences across states, hospital types, and ownership categories.\n\nThe goal is to build a clean, reproducible data analytics project using Python, pandas, and matplotlib while demonstrating a professional workflow for data collection, cleaning, exploratory analysis, and reporting.\n\n## Business Question\n\nHow do hospital quality ratings and reporting patterns vary across U.S. hospitals by geography, hospital type, and ownership?\n\n## Dataset\n\nThe project uses the CMS Hospital General Information dataset from Medicare.gov provider data.\n\nThe dataset includes hospital-level information such as:\n\n* Facility ID\n* Hospital name\n* Address, city, state, and ZIP code\n* Hospital type\n* Hospital ownership\n* Emergency services availability\n* CMS overall hospital rating\n* Quality-measure group counts\n\n## Tools Used\n\n* Python\n* pandas\n* matplotlib\n* Git and GitHub\n* VS Code\n* Git Bash\n\n## Project Structure\n\n```text\ncms-hospital-quality-analytics/\n├── data/\n│   ├── raw/\n│   │   └── hospital_general_info.csv\n│   └── processed/\n│       └── hospital_general_info_clean.csv\n├── outputs/\n│   └── figures/\n│       ├── average_rating_by_hospital_type.png\n│       ├── overall_rating_distribution.png\n│       └── top_states_by_hospital_count.png\n├── reports/\n│   ├── average_rating_by_hospital_type.csv\n│   ├── average_rating_by_ownership.csv\n│   ├── average_rating_by_state.csv\n│   ├── hospital_count_by_state.csv\n│   ├── missing_values_report.csv\n│   └── overall_rating_distribution.csv\n├── src/\n│   ├── download_data.py\n│   ├── clean_data.py\n│   └── eda_summary.py\n├── .gitignore\n├── requirements.txt\n└── README.md\n```\n\n## Workflow\n\n### 1. Data Collection\n\nThe raw CMS hospital dataset is downloaded and saved to:\n\n```text\ndata/raw/hospital_general_info.csv\n```\n\n### 2. Data Cleaning\n\nThe cleaning script standardizes column names, trims text fields, preserves ZIP codes as strings, converts hospital overall ratings to numeric values, and creates a flag for whether a hospital has an available overall rating.\n\nRun:\n\n```bash\npython src/clean_data.py\n```\n\nCleaned data is saved to:\n\n```text\ndata/processed/hospital_general_info_clean.csv\n```\n\n### 3. Exploratory Data Analysis\n\nThe EDA script creates summary reports and charts for hospital counts, rating distributions, missing values, average ratings by state, average ratings by hospital type, and average ratings by ownership.\n\nRun:\n\n```bash\npython src/eda_summary.py\n```\n\nOutputs are saved to:\n\n```text\nreports/\noutputs/figures/\n```\n\n## Visualizations\n\n### Top 15 States by Number of Hospitals\n\n![Top states by hospital count](outputs/figures/top_states_by_hospital_count.png)\n\n### Hospital Overall Rating Distribution\n\n![Hospital overall rating distribution](outputs/figures/overall_rating_distribution.png)\n\n### Average Overall Rating by Hospital Type\n\n![Average rating by hospital type](outputs/figures/average_rating_by_hospital_type.png)\n\n## Key Findings\n\n* The cleaned CMS hospital dataset contains **5,432 hospitals** and **38 columns**.\n\n* Hospital counts were highest in larger states. **Texas** had the most hospitals in the dataset with **468**, followed by **California** with **378** and **Florida** with **221**.\n\n* CMS overall ratings were missing for a large portion of the dataset. **2,250 hospitals**, or **41.42%**, did not have an available overall rating. Because of this, rating-based comparisons were interpreted only among hospitals with available ratings.\n\n* Among hospitals with available overall ratings, ratings were most commonly concentrated around **3 and 4 stars**. The dataset included **987 hospitals rated 3 stars** and **950 hospitals rated 4 stars**.\n\n* State-level average ratings varied among rated hospitals. **Utah** had the highest average overall rating at **4.24** across **29 rated hospitals**, followed by **Colorado** at **3.96** across **49 rated hospitals** and **South Dakota** at **3.89** across **18 rated hospitals**.\n\n* Average ratings also differed by hospital type. **Acute Care - Veterans Administration** hospitals had the highest average overall rating at **4.16** across **112 rated hospitals**. **Critical Access Hospitals** averaged **3.22** across **400 rated hospitals**, while **Acute Care Hospitals** averaged **3.16** across **2,670 rated hospitals**.\n\n* Ownership categories showed meaningful variation, but sample size matters. **Veterans Health Administration** hospitals had the highest average overall rating at **4.16** across **112 rated hospitals**. **Tribal** hospitals averaged **4.00**, but this was based on only **2 rated hospitals**, so that result should be interpreted cautiously.\n\n* The missing-values report showed high missingness in several CMS quality-measure footnote and measure-count fields. These missing values were preserved because they may reflect measure applicability, hospital type, reporting eligibility, or CMS reporting requirements rather than simple data-entry errors.\n\n## Missing Data Handling\n\nMissing values were reviewed and summarized in a dedicated missing-values report. Missing values were preserved rather than automatically removed because many missing fields relate to CMS quality-measure reporting categories that may not apply to every hospital.\n\nThis is especially important for smaller hospitals, specialty hospitals, psychiatric facilities, children’s hospitals, and critical access hospitals, which may not report the same measure groups as larger acute-care hospitals.\n\n## How to Run This Project\n\nClone the repository:\n\n```bash\ngit clone https://github.com/dgraves4/cms-hospital-quality-analytics.git\ncd cms-hospital-quality-analytics\n```\n\nCreate and activate a virtual environment:\n\n```bash\npython -m venv .venv\nsource .venv/Scripts/activate\n```\n\nInstall dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\nRun the scripts:\n\n```bash\npython src/download_data.py\npython src/clean_data.py\npython src/eda_summary.py\n```\n\n## Next Steps\n\nPotential future improvements include:\n\n* Building an interactive dashboard in Power BI or Tableau\n* Adding maps to show hospital distribution by state or region\n* Comparing ratings across ownership types in more detail\n* Adding additional CMS quality datasets\n* Creating a final executive summary of findings\n* Automating the full pipeline with a single command or workflow script\n\n## Project Status\n\nCurrent status: Initial data collection, cleaning, exploratory analysis, reports, and visualizations are complete.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgraves4%2Fcms-hospital-quality-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgraves4%2Fcms-hospital-quality-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgraves4%2Fcms-hospital-quality-analytics/lists"}