Nischay Bikram Thapa
S3819491
According to the Australian Institute of Health and Welfare, 11.3 million patients were admitted in public and private hospitals in 2017-18.
Out of those 61% were in public hospitals with 42% cases being emergency admissions followed by childbirth and medical hospitalisations, whereas in private hospitals, more than 50% cases were surgical and mental health care.
Different hospitals should be able to treat a similar patient in the same amount of time. However, it might not be the case every time.
Are patients discharged soon if they choose to stay in a medium over large hospitals?
This investigation aims to identify whether there is any statistically significant difference in the average length of stay between large and medium hospitals.
Assuming there is no difference in the length of stay on an average, we try to find evidence using hospitals peer-group particularly: large hospitals and medium hospitals over the average length of stay (ALOS).
The data was collected by the Australian Institute of Health and Welfare that represents records of admitted patients in the year 2017 - 2018 and is publicly available.
The average length of stay (ALOS) is calculated as the number of bed days for overnight stays divided by the number of overnight stays and is reported for selected.
After loading data, Peer groups are converted to factors and NP values in Average length of stay (ALOS) are converted to NA values and are ignored for this analysis.
For Peer group, large and medium hospitals are selected.
Data Source: https://www.aihw.gov.au/reports-data/myhospitals/sectors/admitted-patients
Looking at the summary statistics, the average length of stay in a large hospital is 3.99 days with a standard deviation of 1.98 whereas in medium hospital, the average length of stay is 3.7 days with a standard deviation of 1.85.
hosp_summary <- data %>% filter(`Peer group`=="Large hospitals"|`Peer group`=="Medium hospitals")%>%
group_by(`Peer group`) %>%
summarise(
Mean = mean(`Average length of stay (days)`,na.rm=T),
S.D = sd(`Average length of stay (days)`,na.rm=T),
First_quartile = quantile(`Average length of stay (days)`,0.25,na.rm=T),
Third_quartile = quantile(`Average length of stay (days)`,0.75,na.rm=T),
Min = min(`Average length of stay (days)`,na.rm=T),
Max = max(`Average length of stay (days)`,na.rm=T),
Missing = sum(is.na(`Average length of stay (days)`)))
knitr::kable(hosp_summary,caption="Summary Statistics")| Peer group | Mean | S.D | First_quartile | Third_quartile | Min | Max | Missing |
|---|---|---|---|---|---|---|---|
| Large hospitals | 3.983052 | 1.978690 | 2.5 | 4.9 | 1.2 | 12.5 | 0 |
| Medium hospitals | 3.717752 | 1.856438 | 2.4 | 4.5 | 1.0 | 13.2 | 0 |
The histogram shows that several patients were discharged within 0 to 5 days. However, there are longer durations of stay recorded which indicates the distribution is skewed to the right.
ggplot(data = data, aes(`Average length of stay (days)`)) +
geom_histogram(bins=22) +
ylab('Frequency') +
ggtitle('Histogram of Average length of Stay (in days)')medium_large <- data %>% filter(data$`Peer group`=='Large hospitals'|data$`Peer group`=='Medium hospitals')
ggplot(medium_large,aes(`Peer group`,`Average length of stay (days)`))+
geom_boxplot(aes(fill= `Peer group`)) +
ggtitle('Average Length of Stay between Large and Medium Hospitals')\(H_0\): There is no difference in the mean of average length of stay between medium and large hospitals
\(H_a\): There is significant difference between the average length of stay between medium and large hospitals
Mathematically,
\(H_0: \mu_1 - \mu_2 = 0\)
\(H_a: \mu_1 - \mu_2 \, \star \, 0\)
Viewing the normality plot, it is evident that the average length of stay for both large and medium hospitals are skewed to the right. However, due to the large sample size, normality is ignored.
Assuming equal variance, the Levene Test is performed to examine the homogeneity of Variance. The results with \(p\)-value < 0.01 provides evidence that Levene Test is statistically significant. This implies the variance between two groups; large and medium hospitals are not equal.
## Levene's Test for Homogeneity of Variance (center = median)
## Df F value Pr(>F)
## group 5 86.543 < 2.2e-16 ***
## 10032
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
t.test(
`Average length of stay (days)`~ `Peer group`,
data = medium_large,
var.equal = FALSE,
alternative = "two.sided"
)##
## Welch Two Sample t-test
##
## data: Average length of stay (days) by Peer group
## t = 5.2855, df = 4500.1, p-value = 1.313e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.1668947 0.3637059
## sample estimates:
## mean in group Large hospitals mean in group Medium hospitals
## 3.983052 3.717752
A two-sample t-test was used to test for the significant difference in the average length of stay in a medium and large hospital.
While the length of stay showed evidence of non-normality upon examination, the central limit theorem assured that the t-test could be applied due to the large sample size in each group.
The Levene’s Test of Homogeneity of variance showed that equal variance could not be assumed. Hence, Welch Two Sample t-test is carried out.
The results of Welch two-sample t-test assuming unequal variance found a statistically significant difference between the mean of length of stay (ALOS) of medium and large hospitals,t(df=4500.1) = 5.29, p < 0.01, 95% confidence interval for the difference in means [0.167,0.364].
The outcome of the investigation infers that patients admitted to medium-size hospitals have a significantly lower length of stay than patients admitted in large hospitals.
James Baglin 2 April, 2019, Viewed 5 May 2020 [https://astral-theory-157510.appspot.com/secured/MATH1324_Module_07.html#confidence_interval_approach]
Australian Health and Welfare, Viewed May 4 2020 [https://www.aihw.gov.au/reports-data/myhospitals/sectors/admitted-patients]
Karlijn Willems, 12 March 2019, Viewed 9 May 2020 [https://www.datacamp.com/community/tutorials/make-histogram-ggplot2]
Chester Ismay,21 Jan 2019, Viewed 8 May 2020 [https://github.com/ismayc/moderndiver-book/blob/master/10-hypothesis-testing.Rmd]
Martin Schmelzer, Viewed 9 May 2020 [https://stackoverflow.com/questions/37115276/control-alignment-of-two-side-by-side-plots-in-knitr]