Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65055

Combining the data from two variables (in the same data set).

$
0
0

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.

Viewing all articles
Browse latest Browse all 65055

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>