Al Pasaoa asked
> I want to get a one-way table of statistics of a
> variable X, where X is decomposed by nested inequalities, such as:
>
> X>0
> X>5
> X>10
> etc.
>
> Is there a simple command/option for this in Stata?
Nada Wasi suggested
> how about this?
> -construct the new variable,Y, to separate X into
> groups:
> gen Y = 1 if X>0
> replace Y = 2 if X>5
> replace Y = 3 if X>10
> :
> (you could label Y if you want).
> -then, use the command "table"
> table Y, c(mean Y,...)
I think Nada misses a key point here, that the inequalities
are to be nested, so the variables created would have
to be different.
Alternatively, -tabcount- from SSC will do this for you.
. ssc inst tabcount
. tabcount X, c(>0 >5 >10)
Nick
n.j.cox@durham.ac.uk
*
* 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/