Re: [S] Looking for alternative to FOR.. loop

Dave Krantz (dhk@paradox.psych.columbia.edu)
Mon, 15 Jun 1998 18:02:42 -0400


How about using

lm(x[,-1] ~ x[,1])$coefficients[1,]

with no explicit loop? When x is a 52 x 2001 matrix, this takes
3 seconds of elapsed time on my Sparcstation 20.

Dave Krantz
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news