A place to collect my thoughts on data analysis within Enrollment Management. Dare I call it Enrollment Science?
This repo contains my first-ever R Shiny project. It’s simple, and represents a minimally viable app. It’s super basic, but the app allows us to query and visualize the NHL’s Play-by-play event logs for a given game.
I updated the app for the
2015-16
season. There are a few manual updates to the code that I could refactor and allow the end-user to set, but in the short run, it works.
The app also leverages a simple shot probability model that I built.
That repo can be found here.
R
here for your OS.R
R
opens, type, install.packages('shiny')
into the command lineshiny::runGitHub("nhl-shiny", "btibert3")
This should fire up your default modern browser. It will take a few moments to load the data, and will refresh every 20 seconds or so. When you want to quit the app, go back to the terminal and type CONTROL-C
to kill the process.
Clearly this is very unpolished, but just a quick highlight of the dashboard app.
match
errors on the MainPanel of the dashboard.GET
request to refresh the data or if there is a bug in Shiny
.In my previous repo, I highlight a very proof-of-concept model. It’s not elegant, but very effective when estimating a player’s total season goals. With respect to the point estimates (actual probability of a shot going in), it has some room for improvement; AUC is mid .7’s.
The approach I use is simple: fit a logistic regression to predict a given shot going in goal given:
When applying the model to every shot from a player (identified by the NHL playerid
), and correlating the actual versus predicted goals over the course of a season, the R-squared
is a touch under .9
.
helpers.R
for each season.