How do I assign a macro variable in R?
In SAS, I would use the following code
%LET DEPVAR = sales_ind PROC REG DATA=mydata; MODEL &DEPVAR = VAR1
how about this:
reg<-lm(formula(paste(depvar ,'~ var1 + var2')), data=mydata)