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

Re: st: checking for repeated values of a given variable


From   "Mark Clatworthy" <[email protected]>
To   <[email protected]>
Subject   Re: st: checking for repeated values of a given variable
Date   Mon, 05 Apr 2004 20:23:25 +0100

Kenley
Under the options for variables on the drop down menus, there is an option for
listing and dropping duplicate observations according to which variables you
specify.  Once you specify a variable (or variables), Stata drops all but the
first observation it comes to.

I had a similar problem where I merged two files and the using file had more
than one observation than the master, resulting in more '3s' in the merged file
than observations in the original master.  Dropping the duplicates according to
the key variables specified under merge is a good way of ensuring that Stata
does not 'spread' the values in the using file to the merged file (see my
earlier question from last week).
Best wishes
Mark Clatworthy

>>> [email protected] 05/04/04 7:05 PM >>>
I'm creating an ID variable to uniquely identify each case in a dataset 
that I'm piecing together, and it appears that here and there there are 
mistakes in the dataset that result in identical values of the ID variable 
for different cases. The dataset is way too big to look through all of it; 
is there a command that will check to make sure that no values are repeated 
for a given variable?

Thanks,
Kenley

*
*   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/

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index