Hi all,
I have a dataset containing values ranging from 1 to 3. I'd like to replace all the 1 to 3, and all the 3 to 1. But if I first run the code for replacing 1 to 3, and then run the second code to replace 3 to 1, then all the replaced 3 including the original 3 gets replaced with 1. Is there a way to turn only the original 1 and 3 to 3 and 1 respectively? ( I cannot change it to any other value)
Thanks in advance.
Related Posts with Replacing values
How to loop through multiple locals instead of all variables inside each local? Code: local ipv "angry fear intimacy_idx cont12_idx ev12_idx pv12_idx sv12_idx ipv_ovall_idx" local…
How do we use -- e.g. loop over, or save -- all the scalar names in a command's return list without knowing the names in advance?I'd like to be able to access all of the scalar names from a command's return list without knowing w…
Transformation of valuesHi, I have a data set on tumors with the variables karnofsky index/KI (categorical with values 40, …
How to loop through two locals instead of all variables inside each local Code: local ipv "angry fear intimacy_idx cont12_idx ev12_idx pv12_idx sv12_idx ipv_ovall_idx" lo…
Problems corresponding to variable names in stata double-layer loopsI encountered a problem in the process of data merging. I put 5 control variables into 5 sheets of a…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values
Post a Comment