Health care or healthcare is the maintenance of improvement of health via the prevention, diagnosis, and treatement of diesease. Access to health care may vary across countries which is influenced by social and economic conditions as well as the government policies. Health care is considering the mos important determinat in promoting the general physical and mental health well-being of people around the world. One of the most sucessful example of health care effort is the eradication of smallpox around the world.
Healthcare in Canada is delivered through thirteen provincial and territorial systems of publicly funded health care, informally called Medicare. Canada is one of the countries which offer free health care and universal health care toward it’s population. According to Health Care Index for Country 2018 Mid-Year, Canada is ranked 25th among the countries around the world. Beside that, Canadians is strongly support it’s health system for public rather that for-profit private basis.
The aim of this project is to examine Canadians’ attitudes toward their health care system. The dataset for this project and it’s dictionary are gather from Canada goverment open source portal which can be found here. The data description can be found in this link.
library(dplyr) #data manipulation
library(tidyr) #Spread, separate, unite, text mining (also included in the tidyverse package)
library(ggplot2) #visualizations
library(gridExtra) #viewing multiple plots together
library(knitr) #Create nicely formatted output tables
library(kableExtra) #Create nicely formatted output tables
library(formattable) #For the color_tile function
library(DT) #for nicely formatted output tables
library(ggthemes) #for ggplot theme
library(viridis) # to get scale_fill_viridis
healthcare <- read.csv("cdn-attitudes-healthcare_attitudes-canadiens-system-soins.csv",
stringsAsFactors = FALSE, na.strings = c("","NA"), header = TRUE)
glimpse(healthcare)
## Observations: 2,503
## Variables: 39
## $ PrjName <int> 311906, 311906, 311906, 311906, 311906, 311906, 31190...
## $ RecordNo <int> 19, 103, 150, 182, 206, 209, 227, 262, 269, 286, 399,...
## $ CITY <chr> "STE ANNE", "EDMONTON", "MOUNT UNIACKE", "NANAIMO", "...
## $ Q1_CODM1 <chr> "Economy", "Education", "Education", "Economy", "Jobs...
## $ Q1_CODM2 <chr> "#NULL!", "#NULL!", "Jobs/Unemployment", "Environment...
## $ Q1_CODM3 <chr> "#NULL!", "#NULL!", "#NULL!", "Education", "#NULL!", ...
## $ Q1_CODM4 <chr> "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#N...
## $ Q1_CODM5 <chr> "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#N...
## $ Q2 <chr> "8", "5", "7", "7", "9", "7", "6", "8", "4", "3", "7"...
## $ Q3 <chr> "8", "8", "8", "6", "8", "8", "5", "5", "3", "3", "2"...
## $ Q4 <chr> "Strongly agree", "Somewhat agree", "Strongly agree",...
## $ Q5 <chr> "Stay the same", "Stay the same", "Stay the same", "W...
## $ Q6A_M1 <chr> "#NULL!", "The rising cost of providing health care s...
## $ Q6B_M1 <chr> "Long Wait times/Delays", "#NULL!", "Lack of Senior C...
## $ Q6B_M2 <chr> "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#N...
## $ Q6B_M3 <chr> "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#N...
## $ Q6B_M4 <chr> "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#N...
## $ Q6B_M5 <chr> "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#NULL!", "#N...
## $ Q7 <chr> "Current healthcare spending needs to be managed more...
## $ Q8A <int> 12, 40, 15, 998, 25, 50, 20, 20, 2, 30, 15, 50, 15, 4...
## $ Q8B <int> 8, 40, 3, 998, 30, 5, 30, 10, 4, 30, 6, 10, 5, 1, 22,...
## $ Q8C <int> 8, 40, 25, 998, 30, 15, 40, 10, 12, 40, 5, 25, 10, 1,...
## $ Q8D <int> 4, 30, 10, 998, 5, 10, 1, 998, 1, 10, 5, 20, 5, 1, 8,...
## $ Q8E <int> 6, 20, 5, 998, 80, 5, 30, 10, 5, 10, 5, 10, 5, 1, 10,...
## $ Q8F <int> 2, 30, 15, 998, 25, 15, 40, 10, 1, 10, 6, 5, 15, 1, 1...
## $ Q9 <chr> "Health care is an essential service and given its im...
## $ Q10 <chr> "Not enough information", "Just the right amount of i...
## $ Q11 <chr> "1,945", "1,981", "1,974", "1,961", "1,931", "1,975",...
## $ Q12 <chr> "University degree, certificate or diploma", "None", ...
## $ Q13 <chr> "$100,000 to just under $150,000", "$40,000 to just u...
## $ Q14 <chr> "Retired", "Working part-time, that is, less than 35 ...
## $ Q15 <chr> "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes...
## $ Q16 <chr> "Male", "Female", "Male", "Female", "Male", "Male", "...
## $ SREGCODE <chr> "Manitoba", "Alberta", "Nova Scotia", "British Columb...
## $ WTS <dbl> 0.4657, 1.3168, 0.8577, 1.2259, 0.3870, 0.9128, 1.509...
## $ AGE <chr> "66", "30", "37", "50", "80", "36", "43", "60", "56",...
## $ AGEGRP <chr> "65 to 69", "30 to 34", "35 to 39", "50 to 54", "80 t...
## $ REGGRP <chr> "Prairies", "Prairies", "ATL", "BC", "ATL", "Prairies...
## $ LANGINT <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
The dataset shows that there are 2503 observations and 39 variables.
After going through the data description, only relevant variable is selected. We removed the project number, id number and other irrelevant variables. Next we change all the character variables into factor data type.
healthcare_selected <- select(healthcare, "Q1_CODM1", "Q2", "Q3", "Q4", "Q5", "Q6A_M1", "Q6B_M1", "Q7", "Q8A", "Q8B", "Q8C", "Q8D", "Q8E", "Q8F", "Q9", "Q10", "Q11", "Q12", "Q13", "Q14", "Q15", "Q16", "AGE", "AGEGRP")
#change all the character variables into factor
character_vars <- lapply(healthcare_selected, class) == "character"
healthcare_selected[, character_vars] <- lapply(healthcare_selected[, character_vars], as.factor)
First we are going to explore what people thinking of the issues facing Canada today, which one would you say the Government of Canada should focus on most?
# Summarize the frequency of question 1
group <- healthcare_selected %>%
group_by(Q1_CODM1) %>%
summarise(n = n())
# reorder the value
group <- group[order(group$n, decreasing = TRUE),]
group %>%
ggplot(aes(x = reorder(Q1_CODM1, n), y = n)) +
geom_bar(stat = 'identity', fill = 'red') +
geom_text(aes(label = n), stat = 'identity', hjust = -0.1, size = 3) +
coord_flip() +
xlab('Issues to Focus') +
ylab('Frequency') +
ggtitle('Opinion of Issues that Government of Canada Should Focus') +
theme_bw() +
theme(plot.title = element_text(size = 12),
axis.title = element_text(size = 10, face = "bold"))
As presented, Canadians think goverment should focus on Economy, Health Care and Job/Unemployment. Next, we are going to explore the difference between gender opinions.
gender_count <- healthcare_selected %>%
group_by(Q1_CODM1, Q16) %>%
summarise(Total = n())
gender_count %>%
ggplot(aes(Q16, Q1_CODM1, fill = Total)) +
geom_tile(size = 1, color = "white") +
scale_fill_viridis() +
geom_text(aes(label=Total), color='white') +
ggtitle('Gender Opinion on Issues') +
xlab("Gender") +
ylab('Issues') +
guides(fill = FALSE) +
theme(plot.title = element_text(size = 16),
axis.title = element_text(size = 12, face = "bold"))
As you can see, both male and female are concern about Economy, Health care and Job/Unemployment issues.
In this section, I am going to examine the difference of age group, education group and gender, income and employment status on of their rating on Canadian health care system. The question is: “How would you rate the current state of the Canadian health care system? Please use a scale from 1 to 10, where 1 is terrible and 10 is excellent?”
healthcare_selected$Q3 <- recode(healthcare_selected$Q3, '1 - Terrible' = '1', '10 - Excellent' = '10')
healthcare_selected$Q3 <- ordered(healthcare_selected$Q3, levels = c('1','2','3','4','5','6','7','8','9','10'))
age_count <- healthcare_selected %>%
group_by(AGEGRP, Q3) %>%
filter(AGEGRP != 'Refused') %>%
na.omit() %>%
summarise(Total = n())
age_count %>%
ggplot(aes(Q3, AGEGRP, fill = Total)) +
geom_tile(size = 1, color = "white") +
scale_fill_viridis() +
geom_text(aes(label=Total), color='white') +
ggtitle('Age Group on Health Care System Rating') +
xlab("Rating") +
ylab('Age Group') +
guides(fill = FALSE) +
theme(plot.title = element_text(size = 16),
axis.title = element_text(size = 12, face = "bold"))
It seems like majority of the population are somewhat statisfied with the healtcare system given the rating between 5 to 8. Majority of the age group around middle age are somewhat satisfied with the health care system.
gender_rate <- healthcare_selected %>%
group_by(Q3, Q16) %>%
na.omit() %>%
summarise(Total = n())
gender_rate %>%
ggplot(aes(Q3, Q16, fill = Total)) +
geom_tile(size = 1, color = "white") +
scale_fill_viridis() +
geom_text(aes(label=Total), color='white') +
ggtitle('Gender Rating on Health Care System ') +
xlab("Rating") +
ylab('Gender') +
guides(fill = FALSE) +
theme(plot.title = element_text(size = 16),
axis.title = element_text(size = 12, face = "bold"))
There are not much difference on rating between male and female. Both rated Canada’s Health Care System above average.
This section we are going to examine the diffences between education and rating to Canada’s Health Care System.
education_rate <- healthcare_selected %>%
group_by(Q3, Q12) %>%
na.omit() %>%
filter(Q12 != '[DO NOT READ] Refused') %>%
summarise(Total = n())
education_rate %>%
ggplot(aes(Q3, Q12, fill = Total)) +
geom_tile(size = 1, color = "white") +
scale_fill_viridis() +
geom_text(aes(label=Total), color='white') +
ggtitle('Education Group Rating on Health Care System ') +
xlab("Rating") +
ylab('Education Group') +
guides(fill = FALSE) +
theme(plot.title = element_text(size = 12),
axis.title = element_text(size = 12, face = "bold"))
As presented, it shows that individuals with High School diploma, certificate and university degree are more likely to give higher rating to health care system.
This section is going to examine the income group on health care system rating.
healthcare_selected$Q13 <- ordered(healthcare_selected$Q13, levels = c("$150,000 and above", "$100,000 to just under $150,000","$80,000 to just under $100,000", "$60,000 to just under $ 80,000", "$40,000 to just under $ 60,000", "$20,000 to just under $ 40,000", "Under $20,000"))
income_rate <- healthcare_selected %>%
group_by(Q3, Q13) %>%
na.omit() %>%
filter(Q13 != '[DO NOT READ] Refused') %>%
summarise(Total = n())
income_rate %>%
ggplot(aes(Q3, Q13, fill = Total)) +
geom_tile(size = 1, color = "white") +
scale_fill_viridis() +
geom_text(aes(label=Total), color='white') +
ggtitle('Education Group Rating on Health Care System ') +
xlab("Rating") +
ylab('Education Group') +
guides(fill = FALSE) +
theme(plot.title = element_text(size = 16),
axis.title = element_text(size = 12, face = "bold"))
employment_rate <- healthcare_selected %>%
group_by(Q3, Q14) %>%
na.omit() %>%
filter(Q14 != '[DO NOT READ] [IF VOLUNTEERED: Other -- DO NOT SPECIFY]' & Q14 != '[DO NOT READ] Refused') %>%
summarise(Total = n())
employment_rate %>%
ggplot(aes(Q3, Q14, fill = Total)) +
geom_tile(size = 1, color = "white") +
scale_fill_viridis() +
geom_text(aes(label=Total), color='white') +
ggtitle('Employment Status Rating on Health Care System ') +
xlab("Rating") +
ylab('Employment Status') +
guides(fill = FALSE) +
theme(plot.title = element_text(size = 10),
axis.title = element_text(size = 12, face = "bold"))
Generally, individuals who are retired or employed are giving good rating to Canada Goverment Health Care System.