Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

RE: st: RE: problem with factor variable and margins.

From   "Martin Weiss" <>
To   <>
Subject   RE: st: RE: problem with factor variable and margins.
Date   Wed, 17 Mar 2010 19:27:26 +0100


" Should I be reading the full 
discussion of interactions in margins predict for this?"

The interactions that Phil alluded to are described in - help fvvarlist-,
though. Remember, Phil advocated using them in the underlying -tobit-


-----Original Message-----
[] On Behalf Of Rich Steinberg
Sent: Mittwoch, 17. März 2010 19:19
Subject: Re: st: RE: problem with factor variable and margins.

Thanks for the thoughtful response.  But a) margins should be robust, 
able to use variables created other ways.  If for no other reason than 
that stata 11should be helpful to those who use code that worked fine in 
stata 10.b) I have to confess that under multiple deadlines, I did not 
read the full documentation on interactions with the new margins 
command.  I figured it was mostly about interacting one unrelated 
variable with another.  But my two variables are related.  Nainc is a 
dummy variable equalling one if asset income is negative.  I am 
estimating a relationship between asset income and donations that is 
discontinuous at zero -- one limiting point (left intercept???) for the 
segment <0, another value at zero, and a third limiting point (right 
intercept???) for the segment >0, because this allows me to capture some 
unobservable heterogeneity as well as generalizing the functional form.  
So nainc_ainc is 0 for all nonnegative asset income levels and equal to 
asset income for all negative levels.  Should I be reading the full 
discussion of interactions in margins predict for this?

Philip Ender wrote:
> Rich wrote:
>> I think I have tracked down the problem. In addition to the factor
variable nainc, I have a continuous variable nainc_ainc as a regressor
(which is the >indicator times a continuous variable). The margins command
then got confused and assumed that nainc was an abbreviation for nainc_ainc,
which did >appear in the results and subsequent tests. When I rename
nainc_ainc as n2ainc_ainc, my problem goes away -- a marginal effect for the
discrete >change in the factor variable nainc does indeed show up in the
>> If I am right in diagnosing why the rename solves the problem, this means
there is a bug in stata's margins. It is not reporting an ambiguous
>abbreviation, it is simply picking one. Should I report it to stata's tech
staff, or is that something you do, Martin?
> I don't think the problem is with -margins- but with the fact that you
> created the interaction outside of your model.  If you create the
> interaction using the factor variables in the model then -margins- not
> only identifies all of the terms but produces marginal effects that
> take into account the interactions.  Without reproducing you entire
> model, it would look something like this:
> . tobit dv i.naic c.ainc  i.naic#c.ainc ...
> Phil

Rich Steinberg
Department of Economics, 516 Cavanaugh Hall
Indianapolis, IN 46202-5140

"Unanswered email since 1955"

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index