Statalist


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

st: Ambiguous Abbreviation Error


From   Christian Gregory <[email protected]>
To   [email protected]
Subject   st: Ambiguous Abbreviation Error
Date   Wed, 16 Apr 2008 16:22:02 -0400

Hello,

I have a *.do file in which I execute two loops, one inside the other. 

-----Example begins------

forvalues i = 1/3 {
      g h`i' =0 ....
      local n = _N ....
                forvalues j = 1/`n'{
                        .....
                        replace h`i' = expression if id==`j'
           }
}

-----Example Ends----------

The first time through the inner loop (i = 1), it works fine. And it is also fine for the first iteration of the second time through (i =2 j = 1). After that,  I get an error message: r110 h Ambiguous Abbreviation.

I could write the loops as an ado file and bootstrap, but I'm wondering why I get this error and if there is a way to work around it in the program's present form.

Thanks,
Christian 



*
*   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