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

st: Speaking Stata: by varlist

From   Zhehui Luo <>
Subject   st: Speaking Stata: by varlist
Date   Sat, 22 Jun 2002 11:49:32 -0400

Dear Statalisters,

In Stata, the

bysort varlist: list varlist if _N>1

is supposed to find duplicates with respect to the bysort varlist.

I have a data set, and I know by the ID variable there is no duplicates, because if I use

bys ID: gen count=_N
tab count

I get count all equal to 1.

However, if I use

bys ID: list varlist if N>1

Stata starts to list every observation from the top.

Why is this happening?



tab count

* For searches and help try:

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