Statalist


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

st: RE: help with pctile


From   Howard Lempel <HLempel@brookings.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: help with pctile
Date   Thu, 19 Feb 2009 09:24:28 -0500

Janneke,

It sounds like you want the -xtile- command, which categorizes each observation by the percentile it falls in.

Hope this helps.
Howie

Howie Lempel
Research Assistant
The Brookings Institution | Economic Studies
 
1775 Massachusetts Ave NW | Washington DC 20036
hlempel@brookings.edu | p: (202) 238-3576
 
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Janneke Pieters
Sent: Thursday, February 19, 2009 8:52 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: help with pctile

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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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