Repeat regression with varying dependent variable
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 (lsmeans). I need adjusted means for group A and group B, after accounting for some covariates. My final object should be a data frame with predicted means for all 40 dependent variables for group A and group B. This is what I tried, without any success: # Examplified here with 2 outcome variables outcome1 <- c(2, 4, 6, 8, 10, 12, 14, 16) outcome2 <- c(1, 2, 3, 4, 5, 6, 7, 8) var1 <- c("a", "a", "a", "a", "b", "b", "b", "b") var2 <- c