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

Dave Krantz (
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 To unsubscribe
send e-mail to with the BODY of the
message: unsubscribe s-news