Statalist


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

st: how to identify unique id variables within groups?


From   Jia Xiangping <[email protected]>
To   statalist <[email protected]>
Subject   st: how to identify unique id variables within groups?
Date   Wed, 20 May 2009 17:54:57 +0800

Dear all,

For a datafile like :
id                    var1

1			1
1			2
1			3
2			1
2			2
2  		        1

I expect to check whether the value of "var1" within one group of "id"
is unique -- i.e. in group 2, the values are not unique. For a
non-grouped datafile, syntax like -isid- or -duplicates- is able to do
the work. But none of them works when combining with -by-.  Is there
any approach to check the unique  value within groups?

Thanks.



-- 
Xiangping Jia
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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