[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Speaking Stata: by varlist
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: