TidyX 49: rowwise simulation of MLB Batting Average, {gt} table & sparklines

This week, Ellis Hughes and I continue our work on simulation methods in R by introducing the rowwise function from the {tidyverse} package. We use this function to do simulations of batting average at the player level. Basically, the function allows us to easily apply a simulation to each row, which represents one player’s seasons, of the data set. We then build our results into a {gt} table and use sparklines.

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.

 

 

 

TidyX 48: Monte Carlo Simulation for NBA Match Ups

Last week, we used an R optimizer to build a model for predicting game outcomes in the NHL. This week, Ellis Hughes and I continue on that work and build a Monte Carlo Simulation for forecasting NBA games. We use the model to obtain the probability that one team beats the other and then we extract the estimated margin of victory from our simulation and reflect the entire distribution of estimated values, rather than just a single point estimate.

To watch the screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 47: NHL Win Probability, R optimizer, & gt tables

This week, Ellis Hughes and I discuss using an optimization algorithm in R to find team strength ratings for the NHL 2019-2020 season. We show how to then use the results from these ratings to forecast the probability that one team wins over another while accounting for the home ice edge. Finally, we output the team strength ratings into a {gt} table.

To watch the screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 46: Network Graphics & NHL Salaries

This week, Ellis Hughes and I begin by working through the code that Natalie O’Shea created to show Kenyan Census data from this week’s TidyTuesday data set. It was an interesting plot because instead of the common network visual of lines and nodes, she plotted circles nested within circles.

After that, we continue working on NHL data by scraping the salaries of skaters and goalies and explore the relationship between team spending and wins using logistic regression (NOTE: we discussed a lot of the ins and outs of logistic regression in TidyX 29).

To watch the screen cast, CLICK HERE.

To access our code, CLICK HERE.