This study will attempt to determine the relationship between changing the number of nurses per patient and the number of hospital readmissions. Determining the effects of changing nurse staffing could be potentially beneficial because it can lead to an improvement in patient care, increase money efficiency, and lead to particular policy changes for the better. In order to identify this correlation, various datasets from the CMS (U.S. Centers for Medicare & Medicaid Services) will be utilized and observed. The particular details being observed in these datasets are the Number of nurse hours each day (RN, LPN, aides), the number of residents within the facility each day, and from which facility the data is from. Additionally, various nursing homes across the US will be observed for their active nurses per day and number of readmissions to the facility.
In order to gather the necessary data from a particular site (nursing home), a number of steps must be taken. Firstly, the staffing data of the site must be pulled/imported. From the site data, the number of on-duty nurses (during an hour), the number of patients, as well as the site code (providence number) are taken. Then, by first dividing the # of patients by # of active nurses and then multiplying by 24 (hours), the patients per nurse ratio can be acquired. Afterwards, the nursing home’s 4th Quarter Score (out of 5) must be taken as well. For context, the 4th Quarter Score represents the overall patient satisfaction towards the facility.
In order to gather the necessary data from a particular site (nursing home), a number of steps must be taken. Firstly, the staffing data of the site must be pulled/imported. From the site data, the number of on-duty nurses (during an hour), the number of patients, as well as the site code (providence number) are taken. Then, by first dividing the # of patients by # of active nurses and then multiplying by 24 (hours), the patients per nurse ratio can be acquired. Afterwards, the nursing home’s 4th Quarter Score (out of 5) must be taken as well. For context, the 4th Quarter Score represents the overall patient satisfaction towards the facility.
Load staffing data from CMS
url="https://data.cms.gov/data-api/v1/dataset/7e0d53ba-8f02-4c66-98a5-14a1c997c50d/data";pbjData=Import[url,"Dataset"];
Keep only the columns we care about
pbjClean=pbjData[All,<|"provnum"#PROVNUM,"date"DateObject[#WorkDate],"rn"ToExpression[#["Hrs_RN"]],"lpn"ToExpression[#["Hrs_LPN"]],"cna"ToExpression[#["Hrs_CNA"]],"residentcensus"ToExpression[#MDScensus]|>&];
patientsPerNurse=(residentcensus)/(rn+lpn+cna)*24
Out[]=
24residentcensus
cna+lpn+rn
1) Append a “patients_per_nurse” column to pbjClean
pbjWithRatio=pbjClean[All,Append[#,"patients_per_nurse"#["residentcensus"]/Total[{#["rn"],#["lpn"],#["cna"]}]*24]&];
2) Subset to exactly the two columns you want
staffingRatio=pbjWithRatio[All,{"provnum","patients_per_nurse"}];
Now you have a 2-column Dataset
staffingRatio
Out[]=
url="https://drive.google.com/uc?export=download&id=1_Er7T4GGyn75LtV6S9L7LcyTToPNkRZq";qualityData=Import[url,"Dataset"];readmissionClean=qualityData[All,<|"provnum"#["CMS Certification Number (CCN)"],"score"#["Four Quarter Average Score"]|>&];readmissionClean=Select[readmissionClean,NumericQ[#["score"]]&];readmissionClean
Out[]=
staffingRatio(*Datasetwithcolumns"provnum","patients_per_nurse"*)readmissionClean(*Datasetwithcolumns"provnum","score"*)
(*jointhemonprovnum*)combined=JoinAcross[staffingRatio,readmissionClean,"provnum"];combined//Dataset
Out[]=
We can first organize the data by creating a table of patients per nurse values(updated hourly) alongside the site’s providence number. After this, we can create another table of 4 Quarter Score values for that particular nursing home alongside the site’s providence number. After the data has been organized, a 3rd list containing an average patients per nurse value (x) and 4th Quarter score (y) for a specific site can be created. We can then graph out a series of points and then calculate a best fit line. This line represents the trend/correlation between how a nursing home’s Quality Score changes as the Patients per Nurse ratio increases. This trend is also extremely accurate, given that the data is updated hourly as the datasets of the nursing home sites are updated every hour.
1) join on provnum
2) pull out just the numeric {x,y} pairs
3) fit a straight-line model readmission = a + b * patientsPerNurse
4) inspect slope/intercept and R^2
5) show scatter + best-fit line
Upon analyzing the data points of the graph, a majority of the high scoring ratios were present when the patients per nurse ratios were between 4.0 to 8.0. Additionally, as the patients per nurse ratio increases, the average Quality Score seems to gradually decrease. Furthermore, while not a strong trend, there is clearly a negative linear trendline between patient nurse ratios and 4th Quarter Score. As such, while there was not as much of a significant correlation between nurse ratios and Quality Score as we initially thought, there still exists a highly probable connection between the two variables.