Richard is correct.
FAQ . . . . . . . . . . . . . . The use of macros with the power
operator
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . W.
Gould
12/99 I coded `a'^2 and got the wrong sign. Why?
http://www.stata.com/support/faqs/lang/macpow.html
Nick
[email protected]
Richard Williams
At 10:37 PM 11/19/2007, Daniel Waxman wrote:
>There was a wicked exponentiation problem that took a few hours to
>figure out (beware of how Stata evaluates the exponentiation of a
>negative number... e.g. -2^2 evaluates to -4)
I swear there is a FAQ on this but I can't find it. Anyway, yes, as far
as Stata is concerned, you are saying minus 2 squared, rather than
negative 2 squared, i.e. the dash is a minus sign, not a negative sign.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/