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]
AW: st: RE: Deleting similar observations
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
AW: st: RE: Deleting similar observations
Date
Wed, 16 Jun 2010 11:16:17 +0200
<>
I searched the archive for the error message and found things like
http://www.stata.com/statalist/archive/2006-11/msg00782.html, hence my
suspicion, but only George can put an end to the speculation...
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Nick Cox
Gesendet: Mittwoch, 16. Juni 2010 11:11
An: [email protected]
Betreff: RE: st: RE: Deleting similar observations
My guess differs. Martin's code should work in any recent version of
Stata. I suspect a typo, but this remains an open question because
George does not disclose precisely what he typed.
In addition, note that this problem is only a very small step away from
that discussed within an FAQ:
FAQ . . . . . . Listing observations in a group that differ on a
variable
11/01 How do I list observations in a group that differ
on a variable?
http://www.stata.com/support/faqs/data/diff.html
Nick
[email protected]
Martin Weiss
That makes me think you have an old version of Stata. Note you are meant
to
disclose any version other than 11.1.
George Chioran
I try this, but I keep getting the message: "time-series operators not
allowed".
Martin Weiss
So Account 7 should also be -drop-ped, I guess:
***********
clear*
inp byte Account str1 Buy_sell
2 b
2 b
2 s
2 b
5 s
5 s
5 s
5 s
7 s
7 s
end
list, noo
bys Account (Buy_sell): drop if Buy_sell[1]==Buy_sell[_N]
list, noo
***********
George Chioran
I have a database that
looks like this:
Account Buy sell
2 b
2 b
2 s
2 b
5 s
5 s
5 s
5 s
7 s
7 s
Taken per account, I would like to know if
there is a way to delete all the observations that have the same letter
in
the Buy sell variable. In my case this would delete all observations
from
account 5 since they are all only sell.
*
* 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/
*
* 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/