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

Re: st: Possible trouble with -xi-


From   [email protected]
To   [email protected]
Subject   Re: st: Possible trouble with -xi-
Date   Tue, 13 May 2003 14:31:44 -0500

Julian Fennema <[email protected]> runs

    . xi: heckman bgi i.country*bls , sel (d=i.country*bls)

(notice that i.country*bls appears twice in the command) and then
notices that the indicator variables for country only appear in
the main equation part of the -heckman- and do not appear in the
selection equation.

Julian wonders if this is a bug or feature.

This is a feature.  In most cases, this behavior is beneficial.
In the case of heckman and a few other cases it is not helpful.
Let me explain.  First look at "[R] xi" and in particular the
bottom half of page 328 (Version 8 manuals).

In a command like -regress- or -logit- you might want to say
something like

    . regress y x i.cat*z i.cat*q

In this case, you only want the indicator variables for "cat"
included once, but you want the "cat" by "z" interaction included
as well as the "cat" by "q" interaction included in the model.
If -xi- did include the "cat" indicators twice, -regress- would
end up having to throw the repeated ones out as being redundant.

-xi- is acting smart (though it bites in Julian's -heckman-
example).  Before -xi- creates the dummies for a categorical
variable it checks to see if it already has created them.  If so,
it does not create additional ones or relist them in the command.

Julian will need to work around this feature when running
-heckman-.  One way is to first run -xi- as a stand alone program

    . xi i.country*bls

followed by -heckman- using "_I*" twice to list all the created
indicator variables in both places required by the -heckman-
command.

    . heckman bgi _I* , sel(d=_I*)


Ken Higbee    [email protected]
StataCorp     1-800-STATAPC

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