2020 NFL defense data

This is my first assignment, I was told to get into R and load my data that i found/made into R. Im using Rstudio with R markdown to do this project in.

I used data from from pro football reference and nfl website. The website that I used can be found here https://www.pro-football-reference.com/years/2020/opp.htm and here https://www.nfl.com/standings/ . What i did is basically made my own data sheet because the nfl was to simple and the PFR was missing stuff that i wanted.so I made my own data sheet in excel then the turn it into a csv and upload it to git hub.

data = read.csv('https://raw.githubusercontent.com/jacmantooth/applied_stats-/main/2020%20nfl%20defense%20.csv')

What I think my data will show is a correlation between a team defense and a team record. Last semester I did this with NFL offenses and found that running the ball lead to a greater chance of having a winning record.

head(data)
##                  Tm  G Att Cmp  Yds TD DADOT  Air  YAC Bltz  Bltz. Hrry  Hrry.
## 1 Arizona Cardinals 16 570 365 3623 26   7.7 1920 2057  256 39.30%   66 10.10%
## 2   Atlanta Falcons 16 625 425 4697 34   8.5 2757 2248  224 32.80%   73 10.70%
## 3  Baltimore Ravens 16 596 380 3536 22   7.9 2078 1787  290 44.10%   60  9.10%
## 4     Buffalo Bills 16 573 369 3726 23   7.0 2192 1758  230 35.80%   51  7.90%
## 5 Carolina Panthers 16 585 398 3825 28   7.4 2372 1971  153 24.00%   60  9.40%
## 6     Chicago Bears 16 547 350 3705 28   8.6 2377 1751  131 21.40%   50  8.20%
##   QBKD  QBKD. Sk Prss  Prss. MTkl win lose tie rank  PF Y.P TO FL X1stD Int
## 1   54  9.50% 48  168 25.80%  111   8    8   0   12 367 5.3 21 10   363  11
## 2   59  9.40% 29  161 23.60%  100   4   12   0   19 414 6.2 21  9   367  12
## 3   71 11.90% 39  170 25.90%  135  11    5   0    2 303 5.2 22 12   347  10
## 4   46  8.00% 38  135 21.00%  127  13    3   0   16 375 5.5 26 11   351  15
## 5   45  7.70% 29  134 21.00%  119   5   11   0   18 402 5.6 22 15   360   7
## 6   48  8.80% 35  133 21.80%   89   8    8   0   14 370 5.4 18  8   331  10
##   X1stDP RushAtt Yds.1 TD.1 Y.A X1stDR playoff winning.record.
## 1    207     436  2008   13 4.6    118      no              no
## 2    239     380  1677   15 4.4     97      no              no
## 3    213     382  1740   12 4.6     96     yes             yes
## 4    199     414  1914   21 4.6    125     yes             yes
## 5    211     408  1936   17 4.7    114      no              no
## 6    190     438  1814   11 4.1    104     yes              no

The difficulties that I will face are 1.the load time and 2.figuring out what data will I use. Do i go really specific or simple. The data that i am using has thing like time sacked then it goes into detail like time in pocket and first down gained by running. i might even do both for the fun of it.

Using the the summary command I was able to produce the following

summary(data)
##       Tm                  G           Att             Cmp             Yds      
##  Length:32          Min.   :16   Min.   :494.0   Min.   :298.0   Min.   :3051  
##  Class :character   1st Qu.:16   1st Qu.:540.0   1st Qu.:342.5   1st Qu.:3573  
##  Mode  :character   Median :16   Median :557.0   Median :367.0   Median :3807  
##                     Mean   :16   Mean   :563.1   Mean   :367.4   Mean   :3842  
##                     3rd Qu.:16   3rd Qu.:581.2   3rd Qu.:380.8   3rd Qu.:4113  
##                     Max.   :16   Max.   :674.0   Max.   :450.0   Max.   :4697  
##        TD            DADOT            Air            YAC            Bltz      
##  Min.   :17.00   Min.   :7.000   Min.   :1604   Min.   :1376   Min.   : 98.0  
##  1st Qu.:22.75   1st Qu.:7.700   1st Qu.:2141   1st Qu.:1750   1st Qu.:145.8  
##  Median :28.00   Median :8.100   Median :2366   Median :1858   Median :180.0  
##  Mean   :27.22   Mean   :8.181   Mean   :2332   Mean   :1870   Mean   :187.2  
##  3rd Qu.:30.25   3rd Qu.:8.625   3rd Qu.:2502   3rd Qu.:2040   3rd Qu.:225.5  
##  Max.   :38.00   Max.   :9.500   Max.   :2970   Max.   :2282   Max.   :290.0  
##     Bltz.                Hrry          Hrry.                QBKD      
##  Length:32          Min.   :40.00   Length:32          Min.   :29.00  
##  Class :character   1st Qu.:50.00   Class :character   1st Qu.:41.75  
##  Mode  :character   Median :59.50   Mode  :character   Median :47.00  
##                     Mean   :59.84                      Mean   :48.47  
##                     3rd Qu.:69.25                      3rd Qu.:55.25  
##                     Max.   :80.00                      Max.   :71.00  
##     QBKD.                 Sk             Prss          Prss.          
##  Length:32          Min.   :17.00   Min.   :101.0   Length:32         
##  Class :character   1st Qu.:28.50   1st Qu.:132.5   Class :character  
##  Mode  :character   Median :36.50   Median :143.0   Mode  :character  
##                     Mean   :35.47   Mean   :143.8                     
##                     3rd Qu.:42.75   3rd Qu.:160.2                     
##                     Max.   :56.00   Max.   :202.0                     
##       MTkl             win              lose             tie        
##  Min.   : 68.00   Min.   : 1.000   Min.   : 2.000   Min.   :0.0000  
##  1st Qu.: 96.25   1st Qu.: 5.000   1st Qu.: 5.000   1st Qu.:0.0000  
##  Median :109.00   Median : 7.500   Median : 8.500   Median :0.0000  
##  Mean   :107.72   Mean   : 7.969   Mean   : 7.969   Mean   :0.0625  
##  3rd Qu.:120.50   3rd Qu.:11.000   3rd Qu.:11.000   3rd Qu.:0.0000  
##  Max.   :147.00   Max.   :14.000   Max.   :15.000   Max.   :1.0000  
##       rank             PF             Y.P              TO       
##  Min.   : 1.00   Min.   :296.0   Min.   :4.600   Min.   : 9.00  
##  1st Qu.: 8.75   1st Qu.:356.5   1st Qu.:5.300   1st Qu.:18.75  
##  Median :16.50   Median :382.5   Median :5.500   Median :22.00  
##  Mean   :16.50   Mean   :396.6   Mean   :5.572   Mean   :20.78  
##  3rd Qu.:24.25   3rd Qu.:440.8   3rd Qu.:5.900   3rd Qu.:23.00  
##  Max.   :32.00   Max.   :519.0   Max.   :6.300   Max.   :29.00  
##        FL             X1stD            Int            X1stDP     
##  Min.   : 4.000   Min.   :280.0   Min.   : 3.00   Min.   :161.0  
##  1st Qu.: 6.750   1st Qu.:330.5   1st Qu.:10.00   1st Qu.:186.8  
##  Median : 8.000   Median :349.0   Median :12.00   Median :205.0  
##  Mean   : 8.438   Mean   :347.1   Mean   :12.34   Mean   :204.6  
##  3rd Qu.:10.000   3rd Qu.:366.2   3rd Qu.:15.00   3rd Qu.:215.0  
##  Max.   :15.000   Max.   :415.0   Max.   :18.00   Max.   :253.0  
##     RushAtt          Yds.1           TD.1            Y.A       
##  Min.   :358.0   Min.   :1289   Min.   :10.00   Min.   :3.600  
##  1st Qu.:405.2   1st Qu.:1765   1st Qu.:13.00   1st Qu.:4.100  
##  Median :429.0   Median :1888   Median :16.00   Median :4.500  
##  Mean   :431.0   Mean   :1902   Mean   :16.62   Mean   :4.388  
##  3rd Qu.:449.5   3rd Qu.:2030   3rd Qu.:19.25   3rd Qu.:4.600  
##  Max.   :517.0   Max.   :2564   Max.   :27.00   Max.   :5.200  
##      X1stDR         playoff          winning.record.   
##  Min.   : 78.00   Length:32          Length:32         
##  1st Qu.: 97.75   Class :character   Class :character  
##  Median :113.00   Mode  :character   Mode  :character  
##  Mean   :111.28                                        
##  3rd Qu.:120.50                                        
##  Max.   :145.00

ngl R is hard it took me about three days to figure out how to get a data sheet on here. turns out its honestly it is really simple if you just upload it to git hub.maybe im just secertly a blonde, i hope this is what you wanted.