Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: correct way to divide the sample into deciles?


From   "Shourun Guo" <[email protected]>
To   <[email protected]>
Subject   st: correct way to divide the sample into deciles?
Date   Tue, 31 Oct 2006 16:35:37 -0500

I am wondering what is the correct way to divide a sample into 10 deciles
based on the value of variable xyz. What I would do is:

sort xyz
gen decile=group(10)

The 'group' function wil divide the sample into 10 as-nearly equal size
subgroups. Given the variable in interest is sorted beforhand, it looks fine
to me. I am not sure whether this is the right way. Is there any other more
accurate way to do the job?

Another question is that I just upgraded from STATA7 to STATA9. I couldn't
find explanation on function 'group' in STATA9 manuals or online document.
The 'group' function under 'generate' still works as under STATA7 though. I
am wondering whether 'group' is called another name under STATA9.

Shourun

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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