I would like to only get the data from between 2006 - 2011 . I have tried filter(yearID >= 2006 && yearID <= 2011), but that does not work either. Is there a way that I can just get between these years?
Teams2006 <- Teams %>%
select(yearID, teamID, name, G, W, L,attendance) %>%
filter(yearID >= 2006) %>%
mutate(teamID = droplevels(teamID),
Win_Perc = W/(W + L))
I am attempting to run a regression with this data, is there perhaps a better way to do it in the regression than fixing anything above? The regression I have now is, could I sequence it here using by instead?
lm1 = lm(formula = Win_Perc ~ payroll,
data = teamPayroll2006)
summary(lm1)