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

Replacing observation of a variable for a specific subject with the observations of another subject from the same variable

$
0
0
Hi,

I am trying to replace observations for Var1 for subject 1 (ID=1) with the observations of Var1 for subject 2 (ID=2).
i.e.
ID Var1
1 .
2 1
3 0
So I want to change Var1=. for ID=1 to the value of Var1 for ID=2
Is there a way of coding this similar to below (or a different way)?

replace Var1(for ID=1) = Var1(ID=2)
Thank you in advance

Viewing all articles
Browse latest Browse all 65099

Trending Articles



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