Skip to content

Linear Regression, Data is a list

3 messages · livia, Henrique Dallazuanna, Gabor Grothendieck

#
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.
#
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:

  
    
#
See:

http://www.nabble.com/matrix-(column-wise)-multiple-regression-t4862261.html
On Dec 3, 2007 8:58 AM, livia <yn19832 at msn.com> wrote: