I want to figure out how to create a loop or using one of the apply functions to get individual 1:1 regression information for each variable in a dataset against the dependent variable.
Lets say I am using mtcars. How would I write in R code that takes each variable in the data frame and regresses it against MPG?
Even better would be getting a summary of each independent variable with and having some sort of name assignment such as x1=, x2=etc
summary(lm(mpg~eachvar,data=mtcars))