Statalist


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

Re: st: Data Management


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   Re: st: Data Management
Date   Fri, 21 Nov 2008 18:44:51 +0100

" I am not sure if duplicates command will work.. Because I have other
variables in the data. So there are actually no duplicates at all in
the data. "

Not so, the -duplicates- commands allows -varlist-s...

HTH
Martin
_______________________
----- Original Message ----- From: "Rijo John" <[email protected]>
To: <[email protected]>
Sent: Friday, November 21, 2008 6:28 PM
Subject: Re: st: Data Management


Hi Friedrich,
the command you suggested produces pretty much the same result.. it
lists out all the ids irrespective of the differences in city names.

Martin,

I am not sure if duplicates command will work.. Because I have other
variables in the data. So there are actually no duplicates at all in
the data. Only the city name variable is spelt differently in certain
cases. There are many other variables which takes different values for
year 1 and two. So if I issue a duplicate command I would imagine it
may not produce any duplicates at all.

Thanks,
Rijo.

On Fri, Nov 21, 2008 at 11:18 AM, Friedrich Huebler <[email protected]> wrote:
Rijo,

bysort ID: list if City[1]!=City[2]

Friedrich

On Fri, Nov 21, 2008 at 12:08 PM, Rijo John <[email protected]> wrote:
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.

Rijo.
*
*   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/




--
Rijo M John,
Institute for Health Research and Policy (MC 275),
1747 West Roosevelt Road, Room 558,
Chicago, Illinois 60608.
Ph: 312-413-9057
Fax: 312-355-2801
URL: http://ihrp-web.ihrp.uic.edu/
*
*   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/



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