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]

st: RE: endogeneous switching regression with movestay-ado: error after margins command


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: endogeneous switching regression with movestay-ado: error after margins command
Date   Wed, 18 Jan 2012 14:01:40 +0000

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

Nick 
n.j.cox@durham.ac.uk 

Stephani Jens

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);

Does anybody have an idea what the problem might be?
Any help will be greatly appreciated.


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