<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/one-sided-matches-in-the-english-premier-league/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://worldsocceranalytics.com/2018/10/10/one-sided-matches-in-the-english-premier-league/"> World Soccer Analytics</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>While some English Premier League matches are bitterly even in nature, others are historically more one-sided. Using the <a rel="nofollow" href="https://cran.r-project.org/web/packages/engsoccerdata/README.html" target="_blank">engsoccerdata</a> package in R, I looked at EPL results data from 1888 to 2017, and sought to find the answer to the question: what have been the most uneven matches in the English first division?</p>
<p>Observing matches with 30+ games played between the two teams, it seems that the most one-sided English first division match ever is Manchester United – Luton Town, with Manchester United winning over 73% of the 30 fixtures. This is pretty high indeed, and there is only one other fixture with a win rate greater than 70%: Liverpool – QPR, with Liverpool victorious nearly 72% of the time over 46 matches.</p>
<p>An interactive graph can be found at this <a rel="nofollow" href="https://rpubs.com/stefangouyet/427833" target="_blank">link</a>, while here is the static version below:</p>
<p><img data-orig-file="https://worldsocceranalytics.files.wordpress.com/2018/10/static_plot_one_sided_fixtures6.png?w=456" data-orig-size="3543,1771" data-medium-file="https://worldsocceranalytics.files.wordpress.com/2018/10/static_plot_one_sided_fixtures6.png?w=456?w=300" data-attachment-id="156" data-image-meta="{" data-image-description="" src="https://worldsocceranalytics.files.wordpress.com/2018/10/static_plot_one_sided_fixtures6.png?w=456" data-permalink="https://worldsocceranalytics.com/2018/10/10/one-sided-matches-in-the-english-premier-league/static_plot_one_sided_fixtures-7/#main" data-large-file="https://worldsocceranalytics.files.wordpress.com/2018/10/static_plot_one_sided_fixtures6.png?w=456?w=720" alt="static_plot_one_sided_fixtures.png" data-image-title="static_plot_one_sided_fixtures" sizes="(max-width: 720px) 100vw, 720px" data-comments-opened="1" class="wp-image-156" data-recalc-dims="1"></p>
<p> </p>
<p>And below is the code for the analysis (also on <a rel="nofollow" href="https://github.com/stefangouyet/most_one_sided_EPL" target="_blank">Github</a>). There’s certainly a lot more analysis to be done on this dataset so feel free to use my code to make other interesting insights/visualizations.</p>
<p>Step 1: Initial Pre-Processing</p>
<pre>library(dplyr)
library(ggplot2)
library(engsoccerdata)
library(ggiraph)

df &lt;- engsoccerdata::england
#only matches in tier 1 (English First Division and subsequently EPL)
df &lt;- df %>% filter(tier == 1)

#winner of game
df &lt;- df %>% mutate(winner = case_when(
  hgoal > vgoal ~ home,
  hgoal &lt; vgoal ~ visitor,
  TRUE ~ &quot;Draw&quot;
),
loser = case_when(
   hgoal &lt; vgoal ~ home,
   hgoal > vgoal ~ visitor,
   TRUE ~ &quot;Draw&quot;
))
                  
#teams involved
df &lt;- df %>% 
  rowwise %>% 
  mutate(teams_involved = paste(sort(c(home,visitor)),collapse=&quot; - &quot;)) %>% 
  ungroup()

df &lt;- df %>% 
  group_by(teams_involved) %>% 
  mutate(total_games_played = n())

</pre>
<p>Step 2: Count number of wins per fixture and find top 20 most one sided fixtures</p>
<pre>win_count &lt;- df %>% 
  count(winner,
        teams_involved,
        total_games_played) %>% 
  mutate(win_perc = n/total_games_played) %>% 
  ungroup()

more_common_fixtures &lt;- win_count %>% 
  filter(total_games_played>=30)

one_sided_fixtures &lt;- more_common_fixtures %>% 
  ungroup() %>%
  top_n(20,
        wt = win_perc)

</pre>
<p>Step 3: Graph using ggplot2 and ggiraph::geom_bar_interactive()</p>
<pre>top_graph &lt;- one_sided_fixtures %>% 
  ggplot(aes(x = reorder(teams_involved,win_perc),
             y = win_perc,
             tooltip = paste0(winner,&quot; (&quot;,n,&quot; of &quot;,total_games_played,&quot;)&quot;)))+
  geom_bar_interactive(stat=&quot;identity&quot;, fill = &quot;darkblue&quot;)+
  coord_flip()+
  ylim(0,1)+
  labs(title = &quot;The Top 20 Most One-Sided Matches in English Premier League History&quot;,
       y = &quot;Win Percentage&quot;,
       x = NULL,
       caption = &quot;Data from engsoccerdata R package&quot;) + 
  theme(plot.title = element_text(hjust = 0.5))

 ggiraph(code = print(top_graph),width = 0.8)</pre>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://worldsocceranalytics.com/2018/10/10/one-sided-matches-in-the-english-premier-league/"> World Soccer Analytics</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/_rUGAqe8Kho" height="1"></a></div>