I am trying to use lme function from nlme package inside a for loop. I have tried (almost) everything now, but without any luck. Without the loop my lme function are working
lipid <-as.data.frame(cer_data[,c(7:9)])
dim(lipid)
for (i in 1:length(lipid)) {
variable <- lipid[,i]
lme_cer <- lme(variable ~ factor(Remission) + Time + Age + BMI + SEX, random = ~1 | Lacal.Patient.ID, method = "REML", data = cer_data)
print(summary(lme_cer)$tTable)
}
Thank you all for the amazing help!