This project aims to analyze hospital performance and ranking based on various healthcare outcome measures, such as 30-day mortality rates for different medical conditions (heart attack, heart failure, and pneumonia). It includes R scripts for data analysis and a set of functions for finding and ranking hospitals within a state or across states.
The project includes the following main components:
hospital_ranking.R
: R script containing functions for ranking hospitals within a state and across states based on specified outcome measures.outcome-of-care-measures.csv
: CSV data file containing healthcare outcome measures for different hospitals.
This project provides functions for:
- Finding the best or worst hospitals in a specific state for a given outcome measure.
- Ranking hospitals across states based on outcome measures.
- This function finds the best hospital in a specified state for a given outcome measure.
- Arguments:
state
: The 2-character abbreviated name of the state.outcome
: The name of the outcome measure (e.g., "heart attack," "heart failure," or "pneumonia").
- This function ranks hospitals within a state based on a specified outcome measure and rank (best, worst, or a specific rank).
- Arguments:
state
: The 2-character abbreviated name of the state.outcome
: The name of the outcome measure (e.g., "heart attack," "heart failure," or "pneumonia").num
: The rank you want to retrieve ("best," "worst," or a specific numeric rank).
- This function ranks hospitals across states based on a specified outcome measure and rank (best, worst, or a specific rank).
- Arguments:
outcome
: The name of the outcome measure (e.g., "heart attack," "heart failure," or "pneumonia").num
: The rank you want to retrieve ("best," "worst," or a specific numeric rank).
To run the code and use the provided functions, follow these steps:
- Clone this repository to your local machine.
- Ensure you have R installed.
- Install any required R packages (e.g.,
tidyverse
) if not already installed. - Run the R scripts to load and analyze the hospital outcome data and perform hospital rankings.
Contributions to this project are welcome! If you have ideas for improvements, bug fixes, or new features, please open an issue or submit a pull request.
This project is licensed under the MIT License.