s-news
[Top] [All Lists]

product of numeric variables in lm

To: <s-news@lists.biostat.wustl.edu>
Subject: product of numeric variables in lm
From: "Harald Hoogstrate" <Hoogstrate@POINTLOGIC.NL>
Date: Mon, 20 Jan 2003 15:53:23 +0100
Thread-index: AcLAk64me3fxAHJwQtuHnJug7v/Vgw==
Thread-topic: product of numeric variables in lm
Dear all,
 
I am doing a regression with lots of numerical variables on S+ 6.1.
Now I want to include the product of two variables a and b in my regression:
 
lm(y~c+a*b,data="">
 
and I find that the result is very different from what I get if I define D$ab<-D$a*D$b and try
 
lm(y~c+ab,data="">
 
So my questions: what does * do and, more importantly, how can I include the product of two variables without first defining them in my dataframe.
 
Thanks for any help,
 
Harald
<Prev in Thread] Current Thread [Next in Thread>