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

st: RE: reverse the response scale


From   "Copeland, Laurel" <Laurel.Copeland@med.va.gov>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: reverse the response scale
Date   Wed, 11 Feb 2004 07:23:38 -0600

for a scale of 1 to 4, the reverse is 5 minus the original, or

gen flipvar=5-origvar

-----Original Message-----
From: Simon Moore [mailto:mooresc2@cardiff.ac.uk]
Sent: Wednesday, February 11, 2004 8:05 AM
To: statalist@hsphsun2.harvard.edu
Subject: 

Hello Statalist,

I am new to Stata and am trying to work out the solution to something
that probably has a simple solution.

I have data in a variable coded something along the lines of 1(very
happy), 2(happy), 3(not so happy) and 4(miserable).  All I want to do
is switch this around so that 1 becomes 4, 2 becomes 3 and so on.  I
realise that I could use recode but was wondering if there is a
remarkably simple solution that I cannot find.

Thank you in advance
Simon


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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