Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: creating interaction variables


From   TEWODAJ MOGUES <[email protected]>
To   Stata _ <[email protected]>
Subject   st: creating interaction variables
Date   Thu, 10 Jun 2004 23:52:09 -0400

Hi,

I have a simple question. Suppose I want to include in a regression the interaction term x1*x2, where x1 and x2 are two variables. Is there any way for me to NOT have to first create a new variable, say by typing 

gen x1_x2 = x1*x2 ?

I tried running a regression that looks like

regress  y   x1*x2  x3  x4

but that gives an error message. The problem is that I want to try out many different interaction terms with existing variables, and having to create new variables in the above fashion is really a big bother.

Thanks for any ideas,
Tewodaj

~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
Tewodaj Mogues
Dept. of Agricultural and Applied Economics
University of Wisconsin - Madison
427 Lorch St. #317, Taylor Hall
Madison, WI 53706

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index