Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: eliminate negative values and their positive counterpart


From   sara borelli <[email protected]>
To   [email protected]
Subject   st: eliminate negative values and their positive counterpart
Date   Tue, 6 Mar 2007 19:48:21 +0100 (CET)

dear satalist members,

This is an exctract of my data:

personid       charge     proc       date
1000124		+13	  80048	   6/6/2001
1000124		+13	  80076	   6/6/2001
...
1000124		+13	  80048	   6/7/2001
1000124		+13	  80076	   6/7/2001
...
1000124		-13	  80048	   6/7/2001
1000124		-13	  80076	   6/7/2001
...
1000124		+13	  80048	   6/8/2001
...
1000124		+13	  80048	   6/9/2001
...
1000124		+13	  81001	   6/11/2001
...
1000124		+13	  80048	   6/11/2001
1000124		+13	  80048	   6/12/2001

where the dots indicate that other values for the same
personid are in between. I need to eliminate the
negative charges AND their positive counterpart with
the same proc and date. Thus, for example I need to
eliminate the negative
-13	 80048	   6/7/2001
AND its positive counterpart with the same proc and
date:
+13	  80048	   6/7/2001,
and so on.
I should find a way to construct an algorithm that
identifies and eliminates the negatives AND their
poistive counterpart with he same date and procedure,
but I cannot figure that out. 
Any help would be really appreciated

thanks
Sara Borelli




	

	
		
___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html
*
*   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