Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: bys and [_N] within replace


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: bys and [_N] within replace
Date   Wed, 18 Mar 2009 13:36:50 -0000

You may be confusing _n and _N. 

_n indicates the current observation, _n + 1 the next and _n - 1 the
previous one. 

_N indicates, depending on context, the last observation or the number
of observations. 

Nick 
[email protected] 

[email protected]

I am still puzzled about why my code did not work. I thought that I
could use _N to look forward and _N-1 to look backwards, within Id and
Commdate.


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index