## Reverse order of ordinally scaled variables

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

Lama
Posts: 15
Joined: Tue Oct 28, 2008 12:07 am

### Reverse order of ordinally scaled variables

I want to reverse the ranking order of some ordinal variables (some are 5 Likert-scales, some are 10 Likert-scales). To achieve this I recoded the values one after another, and it seems to work, though its quite awkward. Is there an easier solution for my problem?

Example (5-Likert):
c008 = @recode (c008=5, 11, c008)
c008 = @recode (c008=4,12, c008)
c008 = @recode (c008=2, 4, c008)
c008 = @recode (c008=1, 5, c008)
c008 = @recode (c008=11, 1, c008)
c008 = @recode (c008=12, 2,C008)

Gratefully yours
Lama

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11848
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Reverse order of ordinally scaled variables

If the number of elements in the scale is random, and the ordering is somewhat random (as appears to be the case from your example), then I'm not sure there is an easy solution.

startz
Non-normality and collinearity are NOT problems!
Posts: 3371
Joined: Wed Sep 17, 2008 2:25 pm

### Re: Reverse order of ordinally scaled variables

Lama wrote:I want to reverse the ranking order of some ordinal variables (some are 5 Likert-scales, some are 10 Likert-scales). To achieve this I recoded the values one after another, and it seems to work, though its quite awkward. Is there an easier solution for my problem?

Example (5-Likert):
c008 = @recode (c008=5, 11, c008)
c008 = @recode (c008=4,12, c008)
c008 = @recode (c008=2, 4, c008)
c008 = @recode (c008=1, 5, c008)
c008 = @recode (c008=11, 1, c008)
c008 = @recode (c008=12, 2,C008)

Gratefully yours
Lama

It's worse than you think. The code above may not do what you want. Suppose c008 equals 5. The first line recodes it to 11. Then the fifth line recodes it to 1!

EViews Glenn
EViews Developer
Posts: 2597
Joined: Wed Oct 15, 2008 9:17 am

### Re: Reverse order of ordinally scaled variables

I want to reverse the ranking order of some ordinal variables (some are 5 Likert-scales, some are 10 Likert-scales). To achieve this I recoded the values one after another, and it seems to work, though its quite awkward. Is there an easier solution for my problem?

Assuming that the scaling goes from 1-5 and 1-10 and that you merely want to reverse the order, I think that the easiest way is to offset the original series and then change signs.

Code: Select all

`series c008r = -(c008-@max(c008)-1)`

Having said that, the example code provided above doesn't seem to be a mere reversal of the scores. Can you be more specific about how you want the recoding to work?

Lama
Posts: 15
Joined: Tue Oct 28, 2008 12:07 am

### Re: Reverse order of ordinally scaled variables

I'm working with data from the World Values Survey. As in this questionaire for some response items the highest numerical value corresponds to the highest value of the latent variable and for them items it is the other way round I try to reverse the order of some response items so that in the end all items I want to analyze are "Highest numerical value = Highest value of latent variable".

E. G.:
Importance of Religion in your Life
1= very important
2
3
4 = not at all important

Here my aim is to have "1" correspond to "not at all important" etc.

Gratefully yours!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11848
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Reverse order of ordinally scaled variables

If all you want to do is reverse the scoring, then you can do as Glenn said - just do (Max_value + 1) - value. Thus in your example you would do (4+1)-values, which would give:

5-1 = 4
5-2 = 3
5-3 = 2
5-4 = 1

i.e. 1 gets transformed into 4, 2 gets transformed into 3, 3 gets transformed into 2, 4 gets transformed into 1...

Lama
Posts: 15
Joined: Tue Oct 28, 2008 12:07 am

### Re: Reverse order of ordinally scaled variables

Yeah, thanks Glenn, thanks Gareth!

Once again you really helped me. It works fine and the idea of not overwriting the data but storing it in another variable clearly helps to avoid messing up the data..

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11848
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Reverse order of ordinally scaled variables

You don't technically need to create a new variable, of course. You could always do:

Code: Select all

`c008 = @max(c008)+1 - c008`

Lama
Posts: 15
Joined: Tue Oct 28, 2008 12:07 am

### Re: Reverse order of ordinally scaled variables

Yes, you are right. In my case it's definitely better to create a new variable, e.g. if for one reason or another I have to analyze the "original" data later on.