title: Keep only observations with data for all variables
body: <p>I have a dataset with several variables. I want to create a subsample which only includes the observations which have data for all variables, so no missing data in any of the variable. </p>
  
  <p>I know about the <code>dropmiss</code> command in Stata but that does not apply here because I do not want to drop variables, but I want to drop the observations. </p>
  
  <p>I found a question similar to mine in Stack Overflow, but the statistical program used there is SAS and I am using Stata. 
   (<a href="https://stackoverflow.com/questions/28614514/sas-keeping-only-observations-with-all-variables">SAS - Keeping only observations with all variables</a>). </p>
  
  <p>An example (the "." is a missing data):</p>
  
  <pre><code>ID year pension age gender
  1  2006 300    54   F
  2  2007 250    40   M
  3  2006  .     45   M
  4  2005  .      .   F
  </code></pre>
  
  <p>So in this case I only want to keep ID 1 and 2, and <code>drop</code> 3 and 4 from the sample since it contains missing data for some of the variables.</p>