Skip to content
Back to formatted view

Raw Message

Message-ID: <da79af330712030731m7881a655k426600a3c49708c8@mail.gmail.com>
Date: 2007-12-03T15:31:05Z
From: Henrique Dallazuanna
Subject: Linear Regression, Data is a list
In-Reply-To: <14130322.post@talk.nabble.com>

If i understand your question, you can try this:

 lapply(paste("lis$", names(lis), " ~ . ", sep=""), lm, data=lis)

On 03/12/2007, livia <yn19832 at msn.com> wrote:
>
> Hello,
>
> I would like to perform a linear regression and the data is a list.e.g
> lm(list$abc~., data=list) or lm(abc~., data=list), which would give the same
> result.
>
> The problem is I would like to call the response variable in a more general
> form. What I try to achieve is sth like lm(list$(paste("a","b","c"))~.,
> data=list), but it does not work.
>
> Could anyone give me some advice?Many thanks.
>
>
> --
> View this message in context: http://www.nabble.com/Linear-Regression%2C-Data-is-a-list-tf4936685.html#a14130322
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>


-- 
Henrique Dallazuanna
Curitiba-Paran?-Brasil
25? 25' 40" S 49? 16' 22" O