library(dplyr)
regressions <- mtcars %>% group_by(cyl) %>% do(mod = lm(mpg ~ wt, .))
regressions
regressions %>% tidy(mod)
regressions %>% augment(mod)
regressions %>% glance(mod)
# we can provide additional arguments to the tidying function
regressions %>% tidy(mod, conf.int = TRUE)
Run the code above in your browser using DataLab