[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: help with pctile

From   Jeph Herrin <>
Subject   Re: st: help with pctile
Date   Thu, 19 Feb 2009 10:08:05 -0500

I think what you want is -xtile-:

 . xtile percentile = cmpce[pweight=weight], nq(100)

will create a variable -percentile- which categorizes
every value of cmpce according which percentile (1-100)
it falls in.


Janneke Pieters wrote:
Dear users,

I want to generate 100 percentiles for a variable called cmpce. These
will be used later to calculate the mean of cmpce for each percentile.
In Stata10 I type:

pctile percentile = cmpce [pweight = weight], nquantiles(100) genp(pctile)

The new variables percentile and pctile only have a value for the first
100 observations in my data, and a missing value for the other 102257
observations. Is something wrong with my command?

Thanks in advance,
Janneke Pieters

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index