Statalist


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

st: RE: funny behaviour of _N


From   "Martin Weiss" <martin.weiss@uni-tuebingen.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: funny behaviour of _N
Date   Thu, 28 Aug 2008 09:23:38 +0200

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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Ashim Kapoor
Sent: Thursday, August 28, 2008 8:24 AM
To: statalist@hsphsun2.harvard.edu
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/



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