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: using expressions in margins command
From
Jordan Silberman <[email protected]>
To
[email protected]
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/