read.table("full_ab_mri_norm_reorder.csv", header = TRUE, sep = ",")-> x data.matrix(x[, 3])-> edad data.matrix(x[, 16:684])-> brain data.matrix(x[, 9:15])-> ab sink(file = "covfit.txt", append = TRUE, type = "output", split = TRUE) for(i in 16:684){ data.matrix(x[, i])-> b cf = lm(ab ~ b * edad) writeLines(paste("ROI:", names(x[i]))) print(summary(cf)) }