setwd("~/Downloads/AMED3002")
health <- read.csv('life.csv')
scatter.smooth(x=health$Total.expenditure, y= health$Adult.Mortality, xlab= "Total expenditure on healthcare as % of GDP", ylab= "Adult mortality rate", main= "Australian adult mortality rate against government health expenditure", col= "cornflowerblue")
scatter.smooth(x=health$Year, y= health$Total.expenditure, xlab= "Year", ylab= "Total expenditure on healthcare as % of GDP", main= "Australian government total healthcare expenditure over time", col= "cornflowerblue")
scatter.smooth(x=health$Year, y= health$Adult.Mortality, xlab= "Year", ylab= "Adult mortality rate per 1000 people", main= "Average Australian adult mortality rate over time", col= "cornflowerblue")
H0 (Null hypothesis): There is no relationship between percentage healthcare expenditure and adult mortality, the two values are independent (p<0.05) HA (Alternative hypothesis): There is a relationship between percentage healthcare expenditure and adult mortality, the two values are dependent (p>0.05)
linearMod <- lm(Total.expenditure ~ Adult.Mortality, data=health)
summary(linearMod)
##
## Call:
## lm(formula = Total.expenditure ~ Adult.Mortality, data = health)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.4921 -0.3106 -0.1877 0.3638 0.6995
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.742171 0.426702 22.831 7.1e-12 ***
## Adult.Mortality -0.014267 0.006517 -2.189 0.0474 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4057 on 13 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.2693, Adjusted R-squared: 0.2131
## F-statistic: 4.792 on 1 and 13 DF, p-value: 0.04744
P-Value is less than 2.2e^16, therefore statistically significant, and hence the null hypothesis is rejected and there is a relationship between percentage healthcare expenditure and adult mortality rate.