Hi everyone! How are you guys doing?
I'm fairly new on Stata and today I come here with a very simple question.
How can I combine the data from two variables (in the same data set) into one variable. I want to combine the variables in such a way that the data from one variable can replace the missing values from the other.
Here is an example of what I am looking for:
var1 | var2 | newvar |
. | 3 | 3 |
. | 7 | 7 |
4 | . | 4 |
. | . | . |
Any thoughts on how to do this? I looked for an answer exhaustively but couldn't find a solution.
Thank you in advance.