[R] how to do regression analysis for multiple dependent variables at once

Hiroto Miyoshi h_m_ at po.harenet.ne.jp
Sat Feb 15 06:10:03 CET 2003

Dear R-users

I have, say, 5 dependent variables, d1 to d5.
And I also have 2 independent variable x1, x2.
Suppose I need to do regression analyses for all
the dependent variables, using the same set 
of independent variables, x1 and x2.

How can I do the analyses without writing five lines of

I like to write the R codes something like
l <- c("d1","d2","d3","d4","d5")
for( i in l ) lm(i~x1*x2).

However, this does not work.

I hope you get the idea about what I want to do.
So, Could you help me.

Hiroto Miyoshi (三好弘人)
h_m_ at po.harenet.ne.jp

More information about the R-help mailing list