Paulo Regis <[email protected]>:
You are missing quotes:
if (`cons'=="noconstant") & (`tr'="notrend") {
should be
if ("`cons'"=="noconstant") & ("`tr'"="notrend") {
I think.
On Tue, Mar 18, 2008 at 3:38 PM, Paulo Regis
<[email protected]> wrote:
> Dear Stata users,
>
> I am having a problem with local macros. Whenever I need to use the
> -if command, I cannot include in the expression the local. This is not
> the first time I had this kind od problem but I did not find a way
> aroud this time.
>
> My problem is at the end of the code. I get the error:
> constant not found
> r(111);
>
> The three -if with locals in the expression, which I reproduce :
> if (`cons'=="noconstant") & (`tr'="notrend") {
> scalar Zcrit== -3.98
> }
> if (`cons'=="constant") & (`tr'="notrend") {
> scalar Zcrit== -3.86
> }
> if (`cons'=="constant") & (`tr'="trend") {
> scalar Zcrit== -3.39
> }
*
* 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/