Data Analysis
1) Is Cullen Skink more preferred than Partan Bree overall?
____________________________________________________________
Sum of Total Responses
TotalResponses <- df %>%
summarise (TotalResponses = sum(Count))
TotalResponses
## TotalResponses
## 1 973600
What are the total counts by responses?
Response <- df %>%
group_by (Response)%>%
summarise(Total = sum(Count, na.rm = TRUE))
Response
## Source: local data frame [2 x 2]
##
## Response Total
## 1 yes 472900
## 2 no 500700
Let’s see only Yes Responses
Yes <- filter(Response, Response == "yes")
Yes
## Source: local data frame [1 x 2]
##
## Response Total
## 1 yes 472900
Let’s see only No Responses
No <- filter(Response, Response == "no")
No
## Source: local data frame [1 x 2]
##
## Response Total
## 1 no 500700
Less people (472900) prefer Cullen Skink over Partan Bree (500700)
—————————————————————————-
Data Analysis
2) Which city prefers Cullen Skink over Partan Bree, Edinburgh or Glasgow?
_____________________________________________________________________________
Sum of Responses by City
CityResponses <- df %>%
group_by (City, Response)%>%
summarise(Total = sum(Count, na.rm = TRUE))
CityResponses
## Source: local data frame [4 x 3]
## Groups: City
##
## City Response Total
## 1 Edinburgh yes 223100
## 2 Edinburgh no 250700
## 3 Glasgow yes 249800
## 4 Glasgow no 250000
Let’s see yes Responses for city
CityYes <- CityResponses %>%
filter(Response == "yes" )
CityYes
## Source: local data frame [2 x 3]
## Groups: City
##
## City Response Total
## 1 Edinburgh yes 223100
## 2 Glasgow yes 249800
More people (249800) in Glasgow prefer Cullen Skink over Partan Bree than in Edningurgh (223100)
——————————————————————————–
Data Analysis
3) Which age group prefers Cullen Skink over Partan Bree, 16-24 or 25+?
_____________________________________________________________________________
Sum of Responses by AgeGroup
AgeResponses <- df %>%
group_by (AgeGroup, Response)%>%
summarise(Total = sum(Count, na.rm = TRUE))
AgeResponses
## Source: local data frame [4 x 3]
## Groups: AgeGroup
##
## AgeGroup Response Total
## 1 16-24 yes 179500
## 2 16-24 no 78900
## 3 25+ yes 293400
## 4 25+ no 421800
Let’s see which yes responses by Age Group
AgeYes <- AgeResponses %>%
filter(Response == "yes" )
AgeYes
## Source: local data frame [2 x 3]
## Groups: AgeGroup
##
## AgeGroup Response Total
## 1 16-24 yes 179500
## 2 25+ yes 293400
More people in age group of 25+ (293400) prefer Cullen Skink over Partan Bree than in age group of 16-24(179500)
Conclusion
1) Overall less people prefer Cullen Skink over Partan Bree
2) More people in Glasgow prefer Cullen Skink than in Edinburgh
3) More people in the Age group 25+ prefer Cullen Skink over Partan Bree than in age group of 16-24