PremPredict 2019/20

In this year’s PremPredict, there are twenty teams, twenty-one players and a massive £105 up for grabs. In this post, I’ll show the latest standings and our collective expectations for the season.

Robin Penfold
2019-08-10

Welcome to the 2019/20 season of PremPredict!

Rather than create new posts every few months, I thought you’d appreciate a page that updated with the latest results every time that you hit refresh.

With that in mind, here are the very latest standings.

Latest standings

Collective expectations

But what are we collectively expecting from the Premier League this season? Are we expecting it to be a repeat of last season?

By the look of our picks, we seem to side with the bookies. As a group, we predict Manchester City to finish highest on average, with the recently-promoted teams struggling.

And we collectively feel that Sheffield United will come last. But will we be more accurate than before?!

For completeness (and reproducibility), here’s the code that I used to calculate what’s above. Note that the app does things a little differently, but this standalone code should give you the gist of the approach.

Latest standings


library(ggridges)
library(premPredictor)
suppressMessages(library(tidyverse))
  
# player_info <- 
#   "https://www.dropbox.com/s/uin6zk4w5cyk2m1/PremPredict-19-20.csv"
# player_data <- get_player_data(url_value = player_info)

player_data <- read_rds('data_input_2019-20.rds')

results <- get_latest_standings(
  data_input = player_data, 
  use_saved_data = T, 
  data_file = '201920_week1.rds'
  )

Collective expectations


data_input1 <- as_tibble(player_data)
averageView <- round(rowMeans(data_input1[, -1]), 2)
views <- cbind(data_input1[,1], averageView)
  
data_input2 <- data_input1 %>% 
  gather(key = "Player", -Club, value = "Prediction") %>% 
  left_join(views, by = "Club")
  
ggplot(
  data = data_input2,
  mapping = aes(
    y = reorder(Club, -averageView), 
    x = Prediction, 
    fill = averageView, 
    color = averageView
    )
  ) + 
  geom_ridgeline(
    stat = "binline", 
    bins = 20, scale = 0.95, 
    draw_baseline = FALSE
    ) + 
  scale_x_continuous(
    breaks = c(5, 10, 15, 20), 
    labels = c(5, 10, 15, 20)
    ) + 
  labs(
    y = "", x = "", 
    title = "\n Our collective predictions for this season \n"
    ) + 
  scale_fill_gradient(
    low = "green", high = "red", 
    guide=FALSE
    ) + 
  scale_color_gradient(
    low = "green", high = "red", 
    guide=FALSE
    ) +
  theme(
    title = element_text(size = 10), 
    axis.text.y = element_text(size = 6)
    )

Calculation inputs

And here are the two inputs to these calculations:

System settings


R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.15

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
 [1] forcats_0.4.0       stringr_1.4.0       dplyr_0.8.3        
 [4] purrr_0.3.3         readr_1.3.1         tidyr_1.0.0        
 [7] tibble_2.1.3        ggplot2_3.2.1       tidyverse_1.2.1    
[10] premPredictor_0.2.4 ggridges_0.5.1     

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5 xfun_0.9         haven_2.1.1     
 [4] lattice_0.20-38  colorspace_1.4-1 generics_0.0.2  
 [7] vctrs_0.2.0      htmltools_0.4.0  yaml_2.2.0      
[10] rlang_0.4.0      pillar_1.4.2     withr_2.1.2     
[13] glue_1.3.1       modelr_0.1.5     readxl_1.3.1    
[16] lifecycle_0.1.0  plyr_1.8.4       munsell_0.5.0   
[19] gtable_0.3.0     cellranger_1.1.0 rvest_0.3.4     
[22] evaluate_0.14    knitr_1.25       broom_0.5.2     
[25] Rcpp_1.0.2       scales_1.0.0     backports_1.1.5 
[28] jsonlite_1.6     distill_0.7      hms_0.5.1       
[31] digest_0.6.21    stringi_1.4.3    grid_3.6.0      
[34] cli_1.1.0        tools_3.6.0      magrittr_1.5    
[37] lazyeval_0.2.2   crayon_1.3.4     pkgconfig_2.0.3 
[40] zeallot_0.1.0    ellipsis_0.3.0   xml2_1.2.2      
[43] lubridate_1.7.4  assertthat_0.2.1 rmarkdown_1.16  
[46] httr_1.4.1       rstudioapi_0.10  R6_2.4.0        
[49] nlme_3.1-139     compiler_3.6.0