Re: [R] Linear Regression, Data is a list

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Mon, 3 Dec 2007 13:31:05 -0200

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

______________________________________________
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.
Received on Mon 03 Dec 2007 - 15:37:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Dec 2007 - 16:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.