Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: How function "group" works in Stata?


From   Shourun Guo <[email protected]>
To   [email protected]
Subject   st: How function "group" works in Stata?
Date   Fri, 02 Jul 2004 12:54:15 -0400

Say I have a variable "a" and 10 observations with the value 1,2,3,...,10.

gen b=group(2), I will get 2 evenly divided subsample. variable "b" has the value 1,1,1,1,1,2,2,2,2,2.

but if I input, gen c=group(a), variable "c" will have the value 1,1,1,2,3,4,5,7,8,10.

How the value of "c" is assigned? Just curious.
*
*   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