title: Quintiles with different quantity of observations
body: <p>I am using Stata and investigating the variable household net wealth <code>NetWealth</code>). </p>
  
  <p>I want to construct the quintiles of this variable and use the following command--as you can see I use survey data and thus apply survey weights:</p>
  
  <pre><code>xtile Quintile = NetWealth [pw=surveyweight], nq(5)
  </code></pre>
  
  <p>Then I give the following command to check what I have obtained:</p>
  
  <pre><code>tab Quintile, sum(NetWealth)
  </code></pre>
  
  <p>This is the result:</p>
  
  <pre><code>      Means, Standard Deviations and Frequencies of DN3001 Net wealth
  
           5 |
   quantiles |
   of dn3001 |     
  -----------+-----------+
           1 |1519.4221
             |43114.959
             |      154
  -----------+-----------+
           2 | 135506.67 
             | 74360.816 
             |       179 
  -----------+-----------+
           3 | 396712.16 
             |  69715.49 
             |       161 
  -----------+-----------+
           4 | 669065.69 
             | 111102.02 
             |       182 
  -----------+-----------+
           5 | 2552620.5 
             | 3872350.9 
             |       274 
  -----------+-----------+
       Total | 957419.29 
             | 2323329.8 
             |       950 
  </code></pre>
  
  <p>Why do I get a different number of households in each quintile? In particular in the last quintile?</p>
  
  <p>The only explanation that I can come up with is that when Stata constructs quintiles with <code>xtile</code>, it excludes from the computation those observations that present a replicate value of NetWealth. I have had this impression also while consulting the <a href="http://www.stata.com/manuals13/dpctile.pdf" rel="nofollow noreferrer">Stata material</a>.</p>
  
  <p>What do you think?</p>