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

st: RE: Recoding strategy

From   "Jiang, Tao" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Recoding strategy
Date   Wed, 3 Jul 2002 15:24:05 -0400

xpose the data, for each new var, check if it has any repeated value, if
has, then sort it and replace it by _n, then xpose back.

Not sure if it is efficient

-----Original Message-----
From: Nick Winter [mailto:[email protected]]
Sent: Wednesday, July 03, 2002 2:58 PM
To: [email protected]
Subject: Recoding strategy

Any thoughts on efficient ways to accomplish the following recoding task?

I've got six variables, wherein respondents ranked the importance of each of
six strategies.  For the vast majority of cases, respondents assigned one
rank of "1", one of "2" and so on.

Some respondents, however, ranked more than one strategy with the same rank.
This takes many forms: some gave two ranks of "1", then one of "3", "4",
"5", and "6".  Others gave two ranks of "1", then one of "2" through "5" but
no "6".  Others gave more than two of the same rank to different items, etc.

We want to do the following to produce a fully consistent set of rankings:

For multiple identical rankings, randomly order them, and then rank
subsequent ranks sequentially from there.  So, for example, if the data look
like this for two cases:

       S1 S2 S3 S4 S5 S6
        1  1  2  3  4  5
        3  1  1  4  5  6

I would want to change it to:

       S1 S2 S3 S4 S5 S6
        1  2  3  4  5  6
        3  1  2  4  5  6

That is, for the first case, S1 was randomly chosen to be kept as one and S2
as two; and the remaining ranks ordered from there.  Similarly for the
second case.

Any thoughts?

I should say, in closing, that I did not decide on this approach, so while I
would certainly enjoy any commentary on why it's a bad idea, I will need to
implement it regardless...

Nick W.

 Nicholas Winter, Ph.D.                     P 202.939.5343
 Policy Studies Associates                  F 202.939.5732
 1718 Connecticut Avenue, NW     [email protected]
 Washington, DC 20009-1148 
*   For searches and help try:

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