[R] Hi

Oscar Bayona
Mon, 15 Jun 2009 21:42:23 -0000

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?