try the following:
first cbind all the design vectors,
data<-cbind(....)
response<-x
apply(data, 2, function(x) lm(response~x)$coef[2])
It should give you all the slope coef (not multivariate but with an
intercept try lm(response~x-1)$coef   if you do not want the intercept).

----- Original Message ----- 
From: "Martin Wegmann" <[EMAIL PROTECTED]>
To: "R-list" <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 4:21 PM
Subject: [R] regression for several responses


> hello,
>
> I only want to get the slope of a linear regression of ca. 100 variables
> against time.
>
> I can do for each response (100 times)
> var1.lm <- lm(response~predictor)
>
> but I thought that there might be an easier way of doing this. If I am
> including more variables it is doing a multiple regression and the output
> (slope) differs.
>
> any idea?
>
> thanks Martin
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to