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
Collapse+comment out STATA15Hi everyone, my system just updated to STATA15 and I do have some troubles regarding comment out so…
stnet and median survivalHi Listers, I am looking at the stnet command for net survival using Pohar Perme estimation. I woul…
egen(), group QuestionI have string variables of capacity which are "10 cups", "8 cups" and "4 cups". The command egen cap…
Expanding a variable value based on conditions of other variablesHello, I am new to Stata and I have the following problem: I have data according: year statecode m…
How do I eliminate results by condition on number of observations?for example, if I use a command tabulate sclyr, summarize(wager) | Summary of WAGER SCLYRS | Mean …
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values
Post a Comment