library(tidyverse)
library(broom)
library(Stat2Data)
data("NFL2007Standings")

## Using the NFL2007Standings data create a model that predicts WinPct from PointsFor. Examine the model statistics using the glance() function

lm(WinPct ~ PointsFor, data = NFL2007Standings) %>%
glance()
## # A tibble: 1 x 11
##   r.squared adj.r.squared sigma statistic  p.value    df logLik   AIC   BIC
##       <dbl>         <dbl> <dbl>     <dbl>    <dbl> <int>  <dbl> <dbl> <dbl>
## 1     0.762         0.754 0.103      95.8 7.53e-11     2   28.3 -50.7 -46.3
## # … with 2 more variables: deviance <dbl>, df.residual <int>

## Using the NFL2007Standings data create a model that predicts WinPct from PointsFor AND PointsAgainst. Examine the model statistics using the glance() function

lm(WinPct ~ PointsFor + PointsAgainst, data = NFL2007Standings) %>%
glance()
## # A tibble: 1 x 11
##   r.squared adj.r.squared  sigma statistic  p.value    df logLik   AIC
##       <dbl>         <dbl>  <dbl>     <dbl>    <dbl> <int>  <dbl> <dbl>
## 1     0.884         0.876 0.0730      111. 2.60e-14     3   39.9 -71.9
## # … with 3 more variables: BIC <dbl>, deviance <dbl>, df.residual <int>

## What is the $$R^2$$ for the first model? What is the adjusted $$R^2$$

The $$R^2$$ for the first model is 0.76. The adjusted $$R^2$$ is 0.75.

## What is the R^2 for the second model? What is the adjusted R^2?

The $$R^2$$ for the second model is 0.88. The adjusted $$R^2$$ is 0.876.

## Which is better at predicting win percent?

The second model is preferable.