Pass a vector of variables into lm() formula
问题 I was trying to automate a piece of my code so that programming become less tedious. Basically I was trying to do a stepwise selection of variables using fastbw() in the rms package. I would like to pass the list of variables selected by fastbw() into a formula as y ~ x1+x2+x3 , \"x1\" \"x2\" \"x3\" being the list of variables selected by fastbw() Here is the code I tried and did not work olsOAW0.r060 <- ols(roll_pct~byoy+trans_YoY+change18m, subset= helper==\"POPNOAW0_r060\", na.action = na