`

Introduction

This dataset includes data from 7,908 patients who had colorectal surgery at the Cleveland Clinic between 2005 and 2014. In order to be included in this study, patients had to have a surgery that took more than one hour and required general anesthesia, had their esophageal core temperature monitored, and had other required data collected. The variables of interest were: YEAR (year of surgery), Age (patient’s age at the time of surgery), FEMALE (patient’s sex at birth), BMI (patient’s body mass index at time of surgery), CharlsonScore (patient’s Charlson Comorbidity Index score), SurgeryType (type of surgery), SurgDuration (Duration of the surgery, in minutes), Open (Type of surgery. 1 = open surgery, 0 = laparoscopic surgery), DurationHosp (Time the patient stayed in the hospital after surgery, in days) and EndCaseTemp(Patient’s core temperature at the end of surgery, °C).

Question 1: What factors contribute to a longer duration of stay after surgery?

The duration of hospital stay after a surgery a strong indicator in the outcome of a surgery, the recovery of a patient, patient experience and healthcare costs. Especially in a time that healthcare costs are astronomical and the cost of living is becoming increasingly unaffordable the length of a patents stay after a surgery has significant financial implications. Not to mention longer stays often reflect complications and contribute to a more negative patient experience. Despite the actual success of a surgery being the largest contributing factor to the length of hospital stay after the surgery we were curious if any pre-existing factors, health measurements, and surgery factors had an association with the duration of stay. Hence this suggested we should examine the variables DurationHosp (days the patient stayed in the hospital after surgery), Age (patient’s age at the time of surgery), BMI (patient’s body mass index at time of surgery), WGHTLOSS (if the patient has lost weight), CharlsonScore (patient’s Charlson Comorbidity Index score), and SurgDuration (Duration of the surgery, in minutes).

To get an idea on the relationships between the potential contributing factors (age, BMI, Charlson Score, duration of the surgery, and weight loss) and duration of hospital stay we first created a pairs plot. In this plot we were able to see the correlation between the contributing factors and the Duration of Stay colored by weight loss. We observed that the correlations between DurationHosp, Age, BMI, CharlsonScore and SurgDuration are 0.099, 0.014, 0.134, 0.242 respectively which implies very low correlation or association. Additionally, none of the scatterplots show any strong linear relationships as well. This implies that none of the factors of patients and their surgery including their age, BMI, Charlson Score, and duration of surgery have a substantial effect on the duration of hospital stay after surgery. However, since we colored based on weight loss we can see that in all of the scatterplots between duration of hospital stay after surgery and age, BMI, Charlson Score and duration of surgery no weight loss is clustered on the left hand side and weight loss present extends to the right. This implies that perhaps when there is no weight loss the duration of hospital stay after surgery is shorter and when there is weight loss the duration of hospital stay after surgery is longer. Hence we will explore this relationship more.

To further examine the relationship between the WGHTLOSS variable and DurationHosp or in other words the relationship between if the patient lost weight and the Duration of Hospital stay we created a side by side violin plot that are overlaid with boxplots. We can observe that the median of the boxplot for yes weight loss is approximately 10 which is higher than that of the category for no weight loss at 6. The violin for yes weight loss also stretches further into the larger amounts of the duration of hospital stay ranging from approximately 0 to 145 compared to that for no weight loss that ranges from about 0 to 45. Hence we can see that there is likely a difference in the duration of stay if the patient had lost weight or not.

## 
##  Welch Two Sample t-test
## 
## data:  DurationHosp by WGHTLOSS
## t = -25.163, df = 2261.4, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
## 95 percent confidence interval:
##  -6.014527 -5.144856
## sample estimates:
##  mean in group No mean in group Yes 
##          6.666609         12.246301

To further examine if there is a difference in the duration of hospital stay if the patient has lost weight or not we employed a two sample t test. The test, tested if there was a difference in the mean duration of the hospital stay after the surgery between patients that did have weight loss and those that did not. We see that the test showed that the p value is < 2.2e-16 and the mean duration of stay for those that didn’t experience weight loss was 6.666609 compared to 12.246301 for those that did. Hence we can conclude that we can reject the null hypothesis and there is a true difference in means of the duration of hospital stay between those that lost weight and those that didn’t.

Question 2: What attributes affect the type of surgery a patient undergoes?

The type of surgery a patient has is an indicator of the severity of the patient’s condition. There are several types of surgeries a patient can have, but for the purpose of this dataset, it has been divided into 2 types: open and laparoscopic. Open surgery is considered an invasive surgery, while laparoscopic surgery is minimally invasive. Several different factors can influence the type of surgery a patient has, such as gender, age, and their health history. It is important to understand what factors cause the type of surgery a patient gets to provide them with the best care and to mitigate any risks that might occur due to the surgery. We may also be able to see if we can prevent invasive surgery by reducing the impact of some of the factors. In the following graphs, we will be considering whether gender, age, drug abuse, and Charlson score have any impact on the type of surgery a patient received.

This graph is a stacked bar chart, faceted by gender, showing the number of patients receiving each type of surgery, with the bars stacked according to their drug history. From this chart, we can see that, between the two genders, the proportion of laparoscopic to open surgery looks the same. In both facets, there is a much higher count of open surgery than laparoscopic surgery, which is most likely due to the fact that these patients had some sort of colorectal surgery. At first glance, it may look like the number of patients who had a drug abuse history is negligible in both genders who received laparoscopic surgery, but, in fact, a very small proportion of them did have such a history. The proportion of drug abuse does look higher in those who had open surgery, and is higher in both genders. However, we can see that in the male gender, there is a slightly higher proportion of patients who abused drugs and underwent open surgery than in the female gender. Overall, based on this graph, it does look like drug history has some impact on the type of surgery a patient gets, but gender does not seem to make a difference. To further augment this information, we can take a look at these chi-squared tests.

## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  OpenvsGender
## X-squared = 1.6735, df = 1, p-value = 0.1958

This chi-squared test looks to see if there is a difference in proportions between the different genders who get each type of surgery. Since the p-value is above 0.05, we fail to reject the null hypothesis that states there is no difference between the counts, so we can conclude that the counts of each surgery do not differ between the two genders.

## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  OpenvsDrug
## X-squared = 8.1222, df = 1, p-value = 0.004373

This chi-squared test looks to see if there is a difference in the proportions of drug abuse history between surgery types. The p-value in this case is lower than 0.05, which coincides with our conclusion from the barchart that drug abuse does seem to have an effect on the type of surgery a patient receives, due to the counts being different. Now, we will look at a heat map to see if the Charlson score and age also have an impact on the surgery type.

This faceted heat map measures the density of the Charlson score vs age, facetted by the type of surgery. The Charlson score measures the number of comorbidities in a patient, which is essentially the number of deadly diseases. We are looking to see if this score or age has any impact on the type of surgery. Based on the facets, it looks like more patients had open surgery than laparoscopic surgery, as was similar in the previous chart. In Charlson Scores less than 5, it seems that the distribution of age is similar in both surgery types and is evenly distributed across all ages. Both graphs have 2 modes in those areas. However, as we go to higher Charlson Scores, we can see that those points are much more prevalent in the open surgery type and in patients who are older than 50. However, there are few patients of the laparoscopic surgery type that follow this distribution. The open surgery heat map has more modes in higher Charlson Scores as well. From this, we can conclude that there is a relationship between higher Charlson Scores and the type of surgery a patient receives, and these higher scores are much more likely in individuals of older ages. Overall, however, the age of the patient is distributed evenly in both facets, so any aged individual is likely to get either surgery. Therefore, it seems that the Charlson Score does have an impact on surgery type, while age does not.

Question 3: How have surgery outcomes changed over time?

For Question 3, we decided to look at how surgery outcomes have improved or worsened over time. For this topic, we looked at the variables of YEAR, Infection, and SurgDuration. To start off, we looked at what percentage of surgeries each year result in an infection, which resulted in us creating this bar chart.

This chart shows the percentage of surgeries each year that resulted in an infection, which seems to be increasing from around 0.25% in 2009 to 0.75% in 2012 before falling back to around 0.25% in 2014. The main takeaway from this bar chart is that the years around 2012 seemed to be particularly worse in terms of infection compared to the older and more recent years, suggesting that infection rates might not have been improving over time. This finding might also be due to random chance due to the limited number of surgeries with infections in the dataset.

For further analysis about certain surgical outcomes like this, we decided to look at the duration of the surgery and incorporate the infection variable from earlier. To do this we plotted a time series for the surgical duration of surgeries that resulted in an infection and surgeries that did not in addition to plotting dotted lines that differed by 2 times the standard error in order to give some information about the spread.

From this graph we can see that the surgeries that did not result in an infection have a fairly consistent duration and don’t differ much between years, while the surgeries that did result in an infection last longer and have more varied lengths. Especially when considering the very low proportion of surgeries that resulted in an infection (<1%), this seems to suggest that surgery durations haven’t worsened or improved over the time period captured by the dataset. Although the duration of surgeries with infections seems to change year by year, the large spread makes it difficult to make any conclusions with confidence. In order to test some of the questions raised above, we created a new variable called YEAR_model which is just the YEAR-2009 to normalize it for the model. We then created a linear model with YEAR_model, Infection, and their interaction term. The results of the model can be seen in the figure below.

## 
## Call:
## lm(formula = SurgDuration ~ YEAR_model * Infection, data = core_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -221.53  -78.05  -18.94   55.29  621.95 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          213.0464     2.0949 101.699   <2e-16 ***
## YEAR_model             0.1779     0.6697   0.266   0.7906    
## Infection            115.2908    37.6481   3.062   0.0022 ** 
## YEAR_model:Infection  -2.8786    12.3874  -0.232   0.8162    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 99.77 on 7904 degrees of freedom
## Multiple R-squared:  0.004964,   Adjusted R-squared:  0.004586 
## F-statistic: 13.14 on 3 and 7904 DF,  p-value: 1.473e-08

We can see that the only term with a significant p-value is infection, indicating that surgeries that result in an infection are correlated with longer surgeries, since the estimate is positive. Notably, the year and interaction term both have low estimates and insignificant p-values which provides further evidence that the durations of surgeries have not been changing in the time period of the data.

Question 4: What factors affect the Patient’s Core Temperature at the End of Surgery?

For Question 4, we wanted to investigate what factors affect a patient’s core temperature at the end of surgery? Maintaining normal core temperature during surgery is essential. Hypothermia (core temperature < 36°C) is associated with increased rates of infection, delayed wound healing, coagulation issues, and prolonged hospital stays. Thus, understanding which patients are most at risk for low core temperatures can help medical teams proactively apply warming techniques and monitor vulnerable patients more closely. We mainly looked two groups of variables to look for a relationship with EndCaseTemp. We looked at variables that represent physical characteristics, such as BMI and Female. We also looked at variables that represented pre-existing medical conditions, such CHF, VALVE, DM, RENALFAIL, LIVER, METS, TUMOR, and COAG. To examine the relationships between these groups we looked at Scatterplots, Ridgeline plots, and some statistical modeling.

Body mass index (BMI) reflects a patient’s body fatness, and could influence their ability to conserve heat during surgery. Gender differences might also play a role, as physiological differences between males and females could affect body temperature.

The following scatterplot shows the relationship between BMI and End of Case Core Temperature (EndCaseTemp), separated by gender:

The scatterplot shows a slight negative trend between BMI and EndCaseTemp in both males and females, with males having a more significant negative relationship between BMI and EndCaseTemp. Higher BMI patients generally had slightly lower end-of-surgery temperatures, which is the opposite of what we expected, because we belived the body fat may help insulate and maintain warmth during surgery.

While this difference may be statistically significant when looking at the real-world implications of this the difference between people with the lowest and highest BMI on average is still less than a degree for both men and women. So regardless of BMI and Gender, people will have about the same End of Case Temperature.

Beyond physical characteristics, pre-existing health conditions may impair a patient’s temperature loss during surgery. Conditions like heart failure, diabetes, and liver disease can affect vascular control, metabolism, and overall resilience to environmental stress. We created a ridgeline plot to visualize how different pre-existing conditions relate to End of Case Core Temperature:

When examining the Ridgeline plot, while there may be slight differences between all of the different distributions, the differences are negligible. This indicates that having any of these pre-existing medical conditions shouldn’t have an effect end of case core temperature

In conclusion, our analysis found that while both physical factors (BMI, Gender) and medical factors (pre-existing conditions) significantly influence End of Case Core Temperature, neither cause a radical enough change in End of Case Temperature to be useful in practice.

Conclusion

In conclusion, this report aimed to prove and disprove the relationship between several factors of patients who received colorectal surgery. We saw that the duration of hospital stay differed between those who did and didn’t lose weight, while age, BMI, Charlson score, and surgery duration did not seem to have much of a relationship with hospital stay length. Furthermore, we saw that the proportion of open and laparoscopic surgery was similar in both males and females; however, there was a higher proportion of open surgery in those who abused drugs, and it was more prevalent in the male gender. We were also able to conclude that those who had higher Charlson scores were more likely to get open surgery than laparoscopic, but the distribution of the age of patients remained similar in both surgery types. In a larger lens, we were able to see that surgery duration did not change significantly by year overall, but those that resulted in an infection often varied and were longer than those that didn’t. Lastly, we concluded that ending core temperature was not different between genders, and not different between patients with various medical histories, such as liver problems or tumors. Using these various conclusions, we can predict patient outcomes in this specific surgery type given various factors regarding them. Given more data, we would like to explore if these relationships exist within patients who received different surgeries than colorectal surgery. We would also like to explore causation rather than correlation between these various variables to solidify our findings by looking at patients at multiple hospitals throughout the world. It might also be interesting to factor in more advanced surgical methods to see if they play a role in optimizing and improving surgical outcomes, given these various factors. Overall, although we were able to uncover many relationships between patient and surgery factors, we would like to explore and expand upon our research.