This post was updated on .
Hi,
How can I reverse code a continuous variable, ranging from 1 to 10? (it has many intermediate valuse, such as 1.257, 5.74 ect...) Thank you! Ruth. |
If you multiply by -1 it is in reversed order. Then if you want to rescale it to the same 1-10 range you would simply need to add 11, so -10 becomes 1, -1 becomes 10, etc. So the code:
COMPUTE new = (-1*old) + 11. should do the trick. |
Thank you! So, would you agree that a different (and perhaps simpler) compute order would be: COMPUTE new= 11-old Is it the same order as you suggested? Ruth. On Sat, Aug 5, 2017 at 4:13 PM, Andy W [via SPSSX Discussion] <[hidden email]> wrote: If you multiply by -1 it is in reversed order. Then if you want to rescale it to the same 1-10 range you would simply need to add 11, so -10 becomes 1, -1 becomes 10, etc. So the code: Ruth Berkowitz, Ph.D. School of Social Work University of Haifa, Israel |
Administrator
|
Try this:
NEW FILE. DATASET CLOSE ALL. DATA LIST FREE / old (F2.0). BEGIN DATA 1 2 3 4 5 6 7 8 9 10 END DATA. COMPUTE new1 = (-1*old) + 11. COMPUTE new2 = 11-old. FORMATS new1 new2 (F2.0). LIST.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Thank you for your advise! On Tue, Aug 22, 2017 at 12:23 AM, Bruce Weaver [via SPSSX Discussion] <[hidden email]> wrote: Try this: Ruth Berkowitz, Ph.D. School of Social Work University of Haifa, Israel |
Free forum by Nabble | Edit this page |