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

RE: st: bys and [_N] within replace

From   "Nick Cox" <>
To   <>
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. 


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

*   For searches and help try:

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