Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Katherine Picho <thestatsbabe@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Including interaction term when using hireg |
Date | Thu, 20 Mar 2014 15:17:05 -0400 |
I have a regression model that I'd like to perform hierarchical regression on where model 1 & 2 adds IVs, and model 3 adds the interaction between independent variables in the 2nd model. The interaction would be between a dichotomous variable and a continuous one. I am using stata 12 my model is as follows: model 1: y= bo + b1x1 +b2x2 model 2: y = b0 + b1x +b2x + b3X3 +b4X4 model 3: (adds the interaction terrn )==> y = b0 + b1x +b2x + b3X +b4X +b5 (x4*x5) since hireg command wont allow interactions terms specified directly (ie i.x3##x4)-- what I did was generate the interaction variable in stata using the gen command gen x5 = i.x3*x4 and then include that in the hireg command as follows hireg y (x1 x2) (x3 x4) (x5) I'd like to know if I'm on the right track or completely off base with respect to how I handled this. Any feedback would be greatly appreciated. thanks! * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/