Re: [R] how to feed lme() and lmer() data for a loop

2020-02-25 Thread Rui Barradas
Hello, Not possible with lmer? I think it is. At least with the first example of ?lmer it is: library(lme4) Days <- sleepstudy$Days data2 <- data.frame(X = Days, Y = Days, Z = Days) nc <- ncol(data2) lmer_list <- vector("list", length = nc) for(i in seq.int(nc)){ #fm1 <- lmer(Reaction ~ Da

[R] how to feed lme() and lmer() data for a loop

2020-02-25 Thread Federico Calboli
Hi all, I am struggling with an issue related to lme() and lmer(). lm() can easily take stuff on the fly from different objects and be happy: lm(data1[,1] ~ data2[,1] + data3[,45] + data4[,39]) works — always. It also allows me to run nice loops: for(i in 1:whatever){ lm(data1[,1] ~ data2[,i