I\'ve searched both Stack and google for a solution, none found to solve my problem.
I have about 40 dependent variables, for which I aim to obtain adjusted means (lsmea
Here is another option using lapply.
lapply
dependents <- c('outcome1', 'outcome2') lst <- lapply(dependents, function(x) { fit <- lm(paste(x,'~', 'var1+var2+var3'), data=df) summary(lsmeans(fit, 'var1', data=df))}) Map(cbind, lst, outcome = seq_along(dependents))