Skip to content
Back to formatted view

Raw Message

Message-ID: <971536df0812280439q27c3e636pe537bf8944a75620@mail.gmail.com>
Date: 2008-12-28T12:39:12Z
From: Gabor Grothendieck
Subject: how to generalize the arguments for lm() (r-help@lists.R-project.org)
In-Reply-To: <295029.92503.qm@web63908.mail.re1.yahoo.com>

Using the built in CO2 data frame this regresses uptake on all the
other columns:

lm(uptake ~., CO2)

On Sun, Dec 28, 2008 at 2:28 AM, Math Girl <mathmathgurl at yahoo.com> wrote:
> Hello,
>
> How could I generalize the following statement for an arbitrary number of columns instead of 7?
>
> result[[i]]<-lm( returns[,i] ~ factors[,1] + factors[,2] + factors[,3] + factors[,4] + factors[,5] + factors[,6] + factors[,7] )
>
> Thank you,
>
> Mathgurl
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>