Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Deleting Duplicates based on criteria


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Deleting Duplicates based on criteria
Date   Thu, 11 Jul 2013 15:23:18 +0100

Yes,  but tell us the rules for determining the highest charge and
give us a realistic example of a block of observations for some court
case. (Need not be real, just realistic.)
Nick
[email protected]


On 11 July 2013 15:18, Dirlam, Jonathan C. <[email protected]> wrote:
> Dear Statalist,
> I have duplicate observations where the duplicates are the same court case number. I want to eliminate all the observations for a court case except for the observation that has the highest charge (homicide, robbery, etc.) I have 12 dummy variables that capture charges and used the duplicates command to get unique ids for each court case number. Is there a way to write a program that eliminates or keeps duplicates based on criteria you give it (Example, homicidedummy==1) and stops once all but one observation are eliminated?
> Thanks.
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index