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

st: Speaking Stata: by varlist


From   Zhehui Luo <luozhehu@msu.edu>
To   statalist@hsphsun2.harvard.edu
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?

Thanks.

Luo


tab count


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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