Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Local in -if expressions


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: Local in -if expressions
Date   Tue, 18 Mar 2008 16:07:35 -0400

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index