Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: how to flag up obs that are the reverse of other obs?

From   "Ada Ma" <>
To   <>
Subject   st: Re: how to flag up obs that are the reverse of other obs?
Date   Thu, 27 Feb 2003 02:49:31 -0000

Hi again,

My original post:
I want to know how to drop some observations.  For example I have the
following data, the numbers are identifiers:

Original        Fake
1                    23
14                   235
35                    90
45                    87
87                    45

Now the 4th and 5th pairs are the exact opposite of one another.  I want to
drop the 5th observation, but I don't know I can use the data to flag up
such observations so that I can drop it.  Could someone show me the light?

My thanks to David Airey's suggestion, but it didn't work.  I tried
something in the vein of what he's suggested, e.g.:

local i=1
local j=1
gen weirdob=.

while `i'<82845 {

while `j'<`i' {
replace weirdob[`i']=1 if original[`i']==fake[`j'] &
local j=`j'+1

local i=`i'+1

Stata wouldn't do weights. Are there other strategies that I can employ??

Thanks again.

Ada Ma
Department of Economics
University of Aberdeen, Scotland
*   For searches and help try:

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