It looks like you're new here. If you want to get involved, click one of these buttons!
How can I recode my old variable into a new variable?
For example I have a variable which has three categories 1, 2 and 3. I want recode the variable so that 1 becomes 0 and 2,3 become 1. I'm not talking about labeling.
I answered a question similar to yours with a small video, which I left here:
You should use one of these examples:
ifElse(myoldvariable = 1, 0, 1)
ifElse(myoldvariable < 2, 0, 1)
ifElse(myoldvariable > 1, 1, 0)
Thank you. it’s helpful