Now I want to have a multiple testing for linear regression using a loop (select from column 80 to column 160 in mydata), when trying the code as below, it gets errors: invalid variable list for mydata[,i]. I'm a beginner for R, if someone knows how to fix this, please let me know, thanks in advance! This is an example of my test:
for (i in 80:160) {
mlrm <- lm(y~AGE+SEX+mydata[,i], data=mydata)
summary(mlrm)
}