Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Speaking Stata: by varlist

From   "Nick Cox" <>
To   <>
Subject   RE: st: Speaking Stata: by varlist
Date   Mon, 24 Jun 2002 10:15:52 +0100

Joel E. Pike commented on Fred Wolfe:

> >One explanation is that your code:
> >bys ID: list varlist if N>1
> >
> >should be
> >
> >bys ID: list varlist if _N>1
> This actually doesn't make any difference.  Either syntax gives you the
> same result, as I confirmed with my own data after I noticed the same
> thing.  I think in the syntax above, _N is not found, so that for every
> observation _N>1.

Not so. _N is automatically (and temporarily) produced w.r.t. the groups
by -id-.  This is a basic feature of -by:-.

If N exists, it is presumably a variable in the original questioner's data
set. (It could also be a scalar.)

*   For searches and help try:

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