[R] multiple regressions on columns

GOUACHE David D.GOUACHE at arvalisinstitutduvegetal.fr
Tue Feb 24 18:13:25 CET 2009


R-helpers,

A quick question regarding my wanting to run multiple regressions without writing a loop.
Looking at a previous discussion : 
http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9740.html

my objective is to do the "opposite", i.e. instead of having the same independent variable and testing it against multiple dependent variables, my goal is to test multiple independent variables against the same dependent variable.

Using the iris dataset:

iris4 <- as.matrix(iris[,-c(1,5)])
summary(lm(iris4 ~ Sepal.Length, iris))

what I would have liked is to do the following :

summary(lm(Sepal.Length ~ iris4, iris))

and obtain the results from 3 separate regressions, as above, instead of one multiple regression...

Any clues ?

Tanks in advance

David Gouache
ARVALIS - Institut du végétal
Station de La Minière
78280 Guyancourt
Tel: 01.30.12.96.22 / Port: 06.86.08.94.32




More information about the R-help mailing list