Hi I have a simple question. I want to run a "n times" a simple linear regession and save beta in a matrix but I´m not able.
Imagine: Data.txt is a 10*5 file and want to run 4 different stimations always regressing first column on the rest. So I try this: First I run Data on memory This is my function mrp <- function(){ mr<-matrix(0,4,1) for(i in 1:4) r(i)=lm(dat(,i+1)~dat(,1) mr[i] <- coefficients(r(i))) } I execute mrp usin source file choose option but nothing happens.... Where I´m wrong? [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.