So I'm trying to create a linear model between aDOT (average depth of target) and YAC/rec (yards after the catch per reception). Neither of the variables aDOT or YAC/rec are in my data frame so I was wondering how I could create a model between the two?
I tried:
airyards %>%
summarise(aDOT = airyards$air_yards / airyards$tar) %>%
summarise(yac_per_rec = airyards$yac / airyards$rec) %>%
summary(lm(aDOT ~ yac_per_rec))
Then I'll get the error
> airyards %>%
+ summarise(aDOT = airyards$air_yards / airyards$tar) %>%
+ summarise(yac_per_rec = airyards$yac / airyards$rec) %>%
+ summary(lm(aDOT ~ yac_per_rec))
Error: Column `aDOT` must be length 1 (a summary value), not 16757
So then I wasn't sure what to do so I did the sum of the variables
airyards %>%
summarise(aDOT = sum(airyards$air_yards) / sum(airyards$tar) %>%
summarise(yac_per_rec = sum(airyards$yac) / sum(airyards$rec)) %>%
summary(lm(aDOT ~ yac_per_rec))
And literally nothing happened. This is all I got in the console
> airyards %>%
+ summarise(aDOT = sum(airyards$air_yards) / sum(airyards$tar) %>%
+ summarise(yac_per_rec = sum(airyards$yac) / sum(airyards$rec)) %>%
+ summary(lm(aDOT ~ yac_per_rec))
+
I'm very new to this and I'd really appreciate any help