TidyX Episode 50: James-Stein Estimator for MLB Batting Averages

We made it! 50 episodes in one year!

To celebrate, Ellis Hughes and I take the baseball data we used in Episode 49 and build a James-Stein Estimator to attempt to estimate a hitter’s true batting average given some number of observations (at bats).

After building estimates for the players we show how you can combine {gt} tables with {ggplot2} figures in {patchwork} to produce a figure like this:

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.

NOTE: This isn’t the first time I’ve applied the James-Stein Estimator to this sort of problem. Nearly 2 years ago I wrote an R tutorial on this approach, comparing it to a Bayesian approach (CLICK HERE).