[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Re: bysort problem
Nikolaos A. Patsopoulos--
No loop should be necessary, as this example demonstrates. My guess
is that this exercise is also not necessary, but as your ultimate
desired outcome is not explicit, I cannot know if replacing values is
actually a good idea for you.
input var1 var2
egen oldgroup=group(var1 var2)
bys var1 var2: gen obs=_n
egen newgroup=group(var1 var2)
li, noo clean
On 2/26/07, Nikolaos A. Patsopoulos <email@example.com> wrote:
The purpose of the code is to eliminate duplicate observations of var1 &
In the firest pass the algorithm fixes duplicates but new ones might
come-up, so it should run as long as noone is left. The correction is
too small for the real data (the ones here are dummy ones just to test
the code) and the possibility of duplicates very small but still present.
var2 is changed not var1. This was a mistake I made on earlier e-mail.
* For searches and help try: