Hello,

I have a variable called HighEd1 that can assume values from 1 to 8 and each value stands for a specific label (eg 1=Degree level ;...;. 8=non-formal qualification).
I want to invert the scale of values so that becomes: 1=non-formal qualification;...; 8=Degree level.
I have been using the following code but is clearly wrong since the replacement is non-simultaneous but in succession and this leads to values that have been replaced before in time to be replaced again further down in the code.
I need a simultaneous (ie in one shot) code for replacement.

Wrong code:
replace HighEd1=8 if HighEd1==1
replace HighEd1=7 if HighEd1==2
replace HighEd1=6 if HighEd1==3
replace HighEd1=5 if HighEd1==4
replace HighEd1=3 if HighEd1==5
replace HighEd1=4 if HighEd1==6
replace HighEd1=2 if HighEd1==7
replace HighEd1=1 if HighEd1==8

thank you in advance!

Best,

Linda