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

st: RE: Data Management

From   "Martin Weiss" <>
To   <>
Subject   st: RE: Data Management
Date   Fri, 21 Nov 2008 18:15:49 +0100

Might -h duplicates- be better for your purposes? 


-----Original Message-----
[] On Behalf Of Rijo John
Sent: Friday, November 21, 2008 6:08 PM
To: stata
Subject: st: Data Management

Hi statalist,

I have a data set as follows

ID  City          Year
1    City name   1
1    City name   2

The data is suppose to have same city names for each ids for year 1
and two. but there are many occasions where city for the year 1 is
spelt differently thanthat for year 2. I just want to list out or edit
those cities where city names are different for year 1 and 2 for the
same ID. When I issue the following command

bysort ID : list if  City!=City[_n-1]

it lists all observations in the data whether or not the city is spelt
differently in years one and two. Thats strange to me? Can someone
tell what  I am doing wrong here?

Thanks for your help.

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index