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: RE: endogeneous switching regression with movestay-ado: error after margins command
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: RE: endogeneous switching regression with movestay-ado: error after margins command
Date
Thu, 19 Jan 2012 10:06:37 +0000
Thanks for the "probably".
Dropping the observations with missing predictions before calling
-margins- and contacting the authors directly at the World Bank are my
only suggestions.
Nick
On Thu, Jan 19, 2012 at 9:45 AM, Stephani Jens <[email protected]> wrote:
> Thank you Nick,
>
> you are probably right concerning the use of the term "bug".
>
> Regarding your other suggestion, I already tried that before
> posting to statalist (i.e. using -if- and making -margins-
> conditional on the non-missing observations; it gave me
> another error message, “prediction is a function of possibly
> stochastic quantities other than e(b)”.
>
> When using -mfx- instead of -margins-, Stata gives another
> error message telling that it did not find the variable y0
> (or y1, respectively).
>
> So I was wondering if somebody else is working with -movestay-
> and might be able to give me a hint.
>
> Thanks
> Jens
>
>>Date: Wed, 18 Jan 2012 14:01:40 +0000
>>From: Nick Cox <[email protected]>
>>Subject: st: RE: endogeneous switching regression with movestay-ado:
>>error after margins command
>>
>>I wouldn't cry "bug" before I was pretty certain, meaning I have
>>looked at some code and I am convinced it is wrong. A program not
>>behaving in the way you hope is not ipso facto evidence of a bug.
>>
>>- -margins- was introduced in Stata 11. -movestay- was written for
>>Stata 8, which does not rule out it being compatible with -margins-,
>>but certainly means that the authors could not be expected to be
>>presciently aware of how it meshes with -margins-.
>>
>>At a wild guess, this may be soluble by making your -margins- call
>>conditional on there being non-missing predictions, using -if-.
> From: Stephani Jens <[email protected]>
>>I am using the ado-file by Lokshin/Sajaia 2004 called movestay (Stata
>>Journal 4, No. 3) to estimate an endogenous switching regression.
>>After estimation, I want to use the margins command to calculate the
>>marginal effects in the outcome equations (conditional on being
>>observed in that equation) Unfortunately, I get an error message
>>saying " missing predicted values encountered within the estimation
>>sample r(322)". It seems to me that this is a bug.
>>
>>Here is my code:
>>
>>movestay (y $a), select(var1 $a $s) cluster(idnum)
>>
>>** output omitted **
>>
>>margins, dydx($a) atmeans predict(yc1_1)
>>
>>Warning: cannot perform check for estimable functions.
>>missing predicted values encountered within the estimation sample
>>r(322);
>>
*
* 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/