##  Hello everyone,
##
##  I am trying to execute 150 times a lm regression using the 'for' loop,
with 150 vectors for y,
##
##  and always the same vector for x.
##
##  I have an object with 150 elements named "a",
##
##  and a vector of 60 values named "b".
##
##  Each element in "a" has 60 values plus a header.
##
##  When I type:

r <- lm(i ~ b)

for(i in a) print(r)

##  I get 150 times the lm results of the first element of "a" regressed
with "b",
##
##  whereas I would like to have 150 different regression results from each
element in "a"...
##
##  Can someone please help me with the syntax of my loop please?
##
##  Many Thanks,
##
##  Driss Agramelal
##
##  Switzerland
##

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to