Re: [R] interaction effects in a Linear model

2009-11-23 Thread Chuck Cleland
On 11/23/2009 1:06 AM, ashok varma wrote:
 hello,
 
 i am fitting a Linear model using R. I have to fit the model considering all
 the interaction effects of order 1 of the independent variables. But I have
 9 variables. So, it will be difficult for me to write all the 36
 combinations in the model. Can anyone please help how to get this done in
 much smarter way??

  This will include all main effects and two-way interactions:

lm(Y ~ (A + B + C + D + E + F + G + H + I)^2, data=mydata)

 thanks a lot,
 Ashok Varma.
 
   [[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. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
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.


Re: [R] interaction effects in a Linear model

2009-11-23 Thread ashok varma
Hi Cleland and Dennis,

thanks a lot for the answer.


Ashok Varma

On Mon, Nov 23, 2009 at 5:05 PM, Chuck Cleland cclel...@optonline.netwrote:

  On 11/23/2009 1:06 AM, ashok varma wrote:
  hello,
 
  i am fitting a Linear model using R. I have to fit the model considering
 all
  the interaction effects of order 1 of the independent variables. But I
 have
  9 variables. So, it will be difficult for me to write all the 36
  combinations in the model. Can anyone please help how to get this done in
  much smarter way??

  This will include all main effects and two-way interactions:

 lm(Y ~ (A + B + C + D + E + F + G + H + I)^2, data=mydata)

  thanks a lot,
  Ashok Varma.
 
 [[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.htmlhttp://www.r-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.

 --
 Chuck Cleland, Ph.D.
 NDRI, Inc. (www.ndri.org)
 71 West 23rd Street, 8th floor
 New York, NY 10010
 tel: (212) 845-4495 (Tu, Th)
 tel: (732) 512-0171 (M, W, F)
 fax: (917) 438-0894


[[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.


[R] interaction effects in a Linear model

2009-11-22 Thread ashok varma
hello,

i am fitting a Linear model using R. I have to fit the model considering all
the interaction effects of order 1 of the independent variables. But I have
9 variables. So, it will be difficult for me to write all the 36
combinations in the model. Can anyone please help how to get this done in
much smarter way??


thanks a lot,
Ashok Varma.

[[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.