NFL Game Predictor App

Bradley Hof

Application Overview

For this shiny application, we are looking for an easy to use statistical model to predict future NFL scores and winners. We would like to investigate the following co-variates

  • Game Temperature
  • Game Weather Conditions (rain, clouds, etc)
  • Field Surface (grass, turf)
  • Current Vegas Line

Data Structure

The data for this application contain scores on all 2014 NFL games up to week 11

  • HS (Home Score)
  • RS (Road Score)
## 'data.frame':    162 obs. of  9 variables:
##  $ Week     : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ home.team: Factor w/ 32 levels "49ERS","BEARS",..: 2 5 7 8 10 12 13 14 15 18 ...
##  $ away.team: Factor w/ 32 levels "49ERS","BEARS",..: 4 11 21 9 31 1 22 17 27 23 ...
##  $ Line     : num  -6.5 -8 -4.5 -3 -3 3.5 3.5 -10 3 -6.5 ...
##  $ Surface  : Factor w/ 3 levels "Dome","Grass",..: 2 2 2 2 2 3 2 2 1 3 ...
##  $ temp     : num  77 70 79 72 77 84 89 80 72 80 ...
##  $ condition: Factor w/ 22 levels "/53F CHANCE SHOWERS",..: 18 18 16 5 6 18 6 18 5 18 ...
##  $ HS       : int  20 31 14 18 10 17 33 34 37 19 ...
##  $ RS       : int  23 24 20 17 26 28 20 17 34 14 ...

Exploratory Analysis

In the plots below, you can see that a home team score is not affected by the surface of the field. However, the surface does have a slight impact on the road team's score.

plot of chunk unnamed-chunk-3

Linear Model

We used a simple linear model for this game predictor.
Try the NFL Prediction App today!!

load("C:\\projects\\coursera\\nfl\\NFLdata.rda")
homeFit <- lm(RS ~ home.team + away.team + Line + Surface + temp + condition, data=nfl)
plot(homeFit)

plot of chunk unnamed-chunk-4 plot of chunk unnamed-chunk-4 plot of chunk unnamed-chunk-4 plot of chunk unnamed-chunk-4