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: Interaction terms in dynamic models


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Interaction terms in dynamic models
Date   Tue, 10 May 2011 18:45:45 +0200

On Tue, May 10, 2011 at 6:07 PM, Hewan Belay <[email protected]> wrote:
> I am wondering about the following: I am able to include interaction terms with no problem in a range of estimation models, but not in dynamic ones. Is there a reason why this is not working, or do I need to do something differently? Here are some toy examples of what I mean:
>
> All of the following regression commands run just fine:
>
> webuse abdata
> regress wage c.emp#c.cap
> xtreg wage c.emp#c.cap
> xtreg wage c.emp#c.cap, fe
> xtgls wage c.emp#c.cap
> xttobit wage c.emp#c.cap
>
> But the following don't run:
> xtabond wage c.emp#c.cap
> xtdpd L(0/1).wage c.emp#c.cap, dgmmiv(wage) div(c.emp#c.cap)
>
> In the above two, I get the error message "cemp#c:  operator invalid". For some reason xtabond and xtdpd don't seem to recognise the interaction specification c.varname1#c.varname2.

You can add interaction, you just need to make them yourself. Remember
that an interaction nothing other than a new variable containing the
product of two variables.

What you noticed is that Stata's new factor variable notation did not
(yet) make it into -xtabond- and -xtdpd-. This is (rather tersely)
documented in the helpfile by the absence of a sentence like
"indepvars may contain factor variables". It is good that Stata's
helpfiles are concise but here they may have overdone that a bit.
Adding a sentence saying that factor variables are not allowed could
be helpful.

My guess on why StataCorp has not implemented factor variables for
-xtabond- and -stdpd- (yet) is that there is something special about
how variable lists are parsed in these commands that would require
them to do a major rewrite of these commands in order to implement the
factor variable notation for these commands. But that is just my
gut-feeling, I haven't looked at the underlying code of these commands
to substantiate this guess.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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