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]
st: RE: Dropping Observations based on Observations Across Rows
From
Beatrice Benavidez <[email protected]>
To
[email protected]
Subject
st: RE: Dropping Observations based on Observations Across Rows
Date
Thu, 18 Oct 2012 18:11:08 +0400
Hi all,
I have this example subset of a dataset:
Date ID Description
1/1 1 Purchase
1/1 1 Refund
1/1 2 Purchase
1/1 2 Refund
1/1 3 Purchase
1/1 4 Purchase
2/2 1 Purchase
2/2 2 Purchase
2/2 3 Purchase
2/2 3 Refund
2/2 4 Purchase
2/2 4 Refund
For a particular date and ID, there is a description variable where I
have Purchase and Refund
I would like for the one particular date and ID to then drop those
observations completely where there are both Purchase and Refund
counterparts in the subset dataset.
I would then like my subset dataset to be reduced to:
Date ID Description
1/1 3 Purchase
1/1 4 Purchase
2/2 1 Purchase
2/2 2 Purchase
How will I go about doing this.
Thank you so much!
Kind regards,
Beatrice
*
* 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/