Turn the last one into -replace a=b if _n==_N- and it will work... See the
examples in - h generate-
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ashim Kapoor
Sent: Thursday, August 28, 2008 8:24 AM
To: [email protected]
Subject: st: funny behaviour of _N
Hello everyone,
Please compare the following 2 code snippets : -
1.
local num=_N
replace a=b in `num'
2.
replace a=b in _N
Surprisingly only the 1st one works ! Could some one tell me why ?
Thank you,
Ashim
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/