Mahesh Pandey - 3674763
October 22, 2017
financial_habits<-read.csv("aus_saving.csv")financial_habits$Respondent.education.level<- factor(financial_habits$Respondent.education.level,
levels = c("completed tertiary or more",
"secondary", "completed primary or less")
,labels = c("Tertiary or above","Secondary",
"Primary or less"))financial_habits <- financial_habits %>% filter(Respondent.education.level=="Primary or less" | Respondent.education.level=="Secondary" | Respondent.education.level=="Tertiary or above")
primary <- financial_habits %>% filter(Respondent.education.level=="Primary or less")
secondary <- financial_habits %>% filter(Respondent.education.level=="Secondary")
tertiary <- financial_habits %>% filter(Respondent.education.level=="Tertiary or above")financial_habits %>% group_by(Respondent.education.level) %>% summarise(Mean = mean(Month_inc, na.rm = TRUE),
n = n(),
Missing = sum(is.na(Month_inc))) -> table1
knitr::kable(table1)| Respondent.education.level | Mean | n | Missing |
|---|---|---|---|
| Tertiary or above | 12444.897 | 348 | 0 |
| Secondary | 9165.491 | 586 | 0 |
| Primary or less | 6137.804 | 51 | 0 |
monthly_inc.plot<- ggplot(financial_habits, aes(x=Respondent.education.level,y=Month_inc,
fill=Respondent.education.level))+geom_boxplot() +
labs(title="Boxplot of Monthly Income based on education level", y="Monthly Income ($)",
x="Education Level")
monthly_inc.plotprimary_totalcount <- primary %>% summarise(n())
primary_saved <- primary %>% filter(Saved.in.the.past.year=="yes")
primary_saved_count <- primary_saved %>% summarise(n())
table_primary <- matrix(c(primary_saved_count,primary_totalcount),ncol=2)
colnames(table_primary) <- c("Count of people who have Saved","Total Count of people")
rownames(table_primary) <- c("")
table_primary## Count of people who have Saved Total Count of people
## 35 51
secondary_totalcount <- secondary %>% summarise(n())
secondary_saved <- secondary %>% filter(Saved.in.the.past.year=="yes")
secondary_saved_count <- secondary_saved %>% summarise(n())
table_secondary <- matrix(c(secondary_saved_count,secondary_totalcount),ncol=2)
colnames(table_secondary) <- c("Count of people who have Saved","Total Count of people")
rownames(table_secondary) <- c("")
table_secondary## Count of people who have Saved Total Count of people
## 460 586
tertiary_totalcount <- tertiary %>% summarise(n())
tertiary_saved <- tertiary %>% filter(Saved.in.the.past.year=="yes")
tertiary_saved_count <- tertiary_saved %>% summarise(n())
table_tertiary <- matrix(c(tertiary_saved_count,tertiary_totalcount),ncol=2)
colnames(table_tertiary) <- c("Count of people who have Saved","Total Count of people")
rownames(table_tertiary) <- c("")
table_tertiary## Count of people who have Saved Total Count of people
## 311 348