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, statalist.org is already up and running.


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

st: using expressions in margins command


From   Jordan Silberman <silberman.stata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: using expressions in margins command
Date   Wed, 19 Jun 2013 16:46:15 -0400

Hi Stata folks,

The following margins command, which I'm using after xtmixed, works fine:

margins, dydx(time) at(condition=(0 1)) expression( (predict(xb)) ^-4 )

Note that the expression includes the instruction to raise to the power of -4.

What I really want to do is raise to the power of -4.063, to get
estimates in their original metric following a Box-Cox transformation.
Given that the margins command above works fine, you'd think that I'd
just have to replace "-4" in the margins command above with "-4.063".
However, after doing this replacement, the margins command yields the
following error:

Warning: prediction constant over observations.
missing predicted values encountered within the estimation sample

And, strangely, when I change the exponent to -5, it works fine again.

Any idea what might be causing this problem? Any guidance would be
greatly appreciated.

Thanks,
Jordan
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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