title: How to fill in observations using other observations R or Stata
body: <p>I have a dataset like this:</p>
  
  <pre><code>ID dum1 dum2 dum3 var1
  1  0    1    .    hi
  1  0    .    0    hi
  2  1    .    .    bye
  2  0    0    1    .
  </code></pre>
  
  <p>What I'm trying to do is that I want to fill in information based on the same <code>ID</code> if observations are missing. So my end product would be something like:</p>
  
  <pre><code>ID dum1 dum2 dum3 var1
  1  0    1    0    hi
  1  0    1    0    hi
  2  1    0    1    bye
  2  0    0    1    bye
  </code></pre>
  
  <p>Is there any way I can do this in R or Stata?</p>