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
Related Posts with How to reconvert the set of values that a variable can assume to a new set of values simultaneously
(How) Can I calculate a significance test for Kendall´s Tau c in Stata?Dear community, I calculated Kendall´s tau c in Stata "by hand" because the ktau-command only conta…
principal factor vs. principal-component factor option for factor analysis Hello everyone! Can someone explain me the difference between the "principal-factor" and "principa…
Conditional logistic regressionHi! I am new to this forum and looking for some advice please. I have run a conditional logistic reg…
Represent Table to Line graphGreetings. I would want to transform my tabulation: ta bdcategory year to be represented in a line g…
Monthly rolling regressions - recording residualsHi All, Thanks for reading. I currently have daily time series data for the periods from July 2010…
Subscribe to:
Post Comments (Atom)
0 Response to How to reconvert the set of values that a variable can assume to a new set of values simultaneously
Post a Comment