Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Including interaction term when using hireg


From   Richard Williams <[email protected]>
To   [email protected], [email protected]
Subject   Re: st: Including interaction term when using hireg
Date   Thu, 20 Mar 2014 15:36:14 -0500

You can use hireg (Paul Bern's user-written command) but since you have Stata 12 you might as well use the built-in command -nestreg-, which was inspired by hireg.

nestreg and hireg are one way of doing this -- for other approaches, including approaches that let you use factor variables, see

http://www3.nd.edu/~rwilliam/xsoc63993/l51.pdf

At 02:17 PM 3/20/2014, Katherine Picho wrote:
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/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index