Untitled
3 years ago in Plain Text
#Import data
FullEPLFinal <- `FullEPLFinal.(1)`
#Isolate the columns we will be using for our dataset.
my_dataEPL <- FullEPLFinal[c(4, 5, 8, 11)]
# Now, only count the instances where the HTResult is the same as the FTResult
library(tidyverse)
HTMomentum <- my_dataEPL[c("Home", "Away", "HTResult", "FTResult")] %>%
subset(FTResult!= "D")%>%
subset(HTResult!="D") %>%
subset(HTResult==FTResult)
HTMomentum_Home <- my_dataEPL[c("Home","Away", "HTResult", "FTResult")] %>%
subset(FTResult!= "D")%>%
subset(HTResult!= "D") %>%
subset(HTResult!= "A")
HTMomentum_HomePie <- HTMomentum_Home %>%
count(FTResult) %>%
mutate(FTResult = factor(FTResult), percentage = n / sum(n)) %>%
ggplot(aes(x = "", percentage, fill = FTResult)) +
geom_col(color="white") +
coord_polar(theta = "y", start=0) +
theme_void() +
ggtitle("Full Time Results of Home Teams \n who were leading at Half Time ")
HTMomentum_HomePie
HTMomentum_Away<- my_dataEPL[c("Home","Away", "HTResult", "FTResult")] %>%
subset(FTResult!= "D")%>%
subset(HTResult!= "D") %>%
subset(HTResult!= "H")
HTMomentum_AwayPie <- HTMomentum_Away%>%
count(FTResult) %>%
mutate(FTResult = factor(FTResult), percentage = n / sum(n)) %>%
ggplot(aes(x = "", percentage, fill = FTResult)) +
geom_col(color="white") +
coord_polar(theta = "y", start=0) +
theme_void() +
ggtitle("Full Time Results of Away Teams \n who were leading at Half Time ")
HTMomentum_AwayPie
#Summary
#Looking at the half time results, out of 1884 matches played (excluding the draws), 1147 games were won by the home team and 737 games were won by the away team.
#HOME: Out of the 1147 home teams that won in the first half, 1086 home teams continued to win in the full time. Hence only 61 Home teams lost even after winning at half time.
#AWAY: Out of the 737 away teams that won in the first half, 645 away teams continued to win in the full time, hence only 92 away teams lost even after winning at half time
#Betting: In terms of betting, one could possibly increase their bets if their team is winning at HT or withdraw their betting if they are loosing at HT.
#in terms of playing at home, if the home team is loosing at HT, fans may expect a higher chance of recovery and winning the game as opposed to if the away team is loosing at HT, one would not expect a recovery.