Statalist


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

st: RE: RE: AW: Rank transformation


From   "Kieran McCaul" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: AW: Rank transformation
Date   Mon, 22 Jun 2009 05:21:42 +0800

,,,

How about this:


clear

input str3 Q  RESP1 RESP2
Q01	3	2
Q02	2	5
Q03	4	5
Q04	1	3
Q05	4	4
Q06	3	2
Q07	4	4
Q08	2	3
Q09	4	4
Q10	3	4
Q11	4	4
Q12	4	5
Q13	5	4
Q14	4	1
end

egen tmp = rank(RESP1)
sort tmp
gen order = _n
by tmp: gen rank1 = order[1]
drop tmp order

egen tmp = rank(RESP2)
sort tmp
gen order = _n
by tmp: gen rank2 = order[1]
drop tmp order

sort Q
list





______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: [email protected]
http://myprofile.cos.com/mccaul 
http://www.researcherid.com/rid/B-8751-2008
______________________________________________
If you live to be one hundred, you've got it made.
Very few people die past that age - George Burns

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Apostolos Ballas
Sent: Monday, 22 June 2009 1:37 AM
To: [email protected]
Subject: st: RE: AW: Rank transformation

Let's say for respondents 1 and 2 the answers are as follows:

   RESP.1 RESP.2
Q1	3	2
Q2	2	5
Q3	4	5
Q4	1	3
Q5	4	4
Q6	3	2
Q7	4	4
Q8	2	3
Q9	4	4
Q10	3	4
Q11	4	4
Q12	4	5
Q13	5	4
Q14	4	1

I want to recode it as follows:

   RESP.1  RESP.2
Q1	4	2
Q2	2	12
Q3	7	12
Q4	1	4
Q5	7	6
Q6	4	2
Q7	7	6
Q8	2	4
Q9	7	6
Q10	4	6
Q11	7	6
Q12	7	12
Q13	14	6
Q14	7	1

I hope that this clarifies my problem.

My thanks,

Apostolos Ballas 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Sunday, June 21, 2009 5:09 PM
To: [email protected]
Subject: st: AW: Rank transformation


<> 

Forget about your spreadsheet thing and stick to Stata, first of all.
Secondly, give an excerpt from your data, as your request sounds easily
doable...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Apostolos
Ballas
Gesendet: Sonntag, 21. Juni 2009 16:06
An: [email protected]
Betreff: st: Rank transformation

I have a dataset where X respondents have replied to 10 questions. Answers
are on a Likert scale. I want to transform the data where the highest
scoring question is ranked 1st and the lowest 10th. Is there a simple way
that I can do that automatically in Stata or should I recode everything in
Excel?

Thanks in advance for all assistance.

Apostolos Ballas

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


*
*   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