I want to improve the way to insert predictors in a regression function:
fm <- lm(formula= df$dependent_variable ~ df[,2] + df[,3]+ df[,4], data = df)
df = data.frame
In this example I put only 4 predictors and 1 dependent_variable. Actually I have 191 predictors. I think I need to a loop script to put all these predictors. Suggestions?