Alternatively one can find -CntUniq- inside codebook.ado, cut it and
paste into CntUniq.ado. It requires 2 arguments, variable of interest
and a touse marker 0/1.
sysuse auto
gen marker=weight>4000
CntUniq weight marker
return list
codebook weight
To understand, which result means what, compare with the results from -codebook-
Best regards, Sergiy
On 8/30/07, Nick Cox <[email protected]> wrote:
> If it did this, it would be (a) documented
> and (b) evident from -return list- after
> applying the command.
>
> -codebook- is an r-class command, but the r-class
> results issued are restricted to problem reports.
>
> More positively, when you say "unique" values
> I take it that you mean "distinct". Either way,
>
> . search unique, faq
>
> points to various ways of finding this out,
> including dedicated programs. One that sticks
> in my mind somehow is -distinct- from SSC by
> Gary Longton and another. Also you could
> do something like
>
> . levelsof mpg, local(levels)
>
> . di `: word count `levels''
>
> Nick
> [email protected]
>
> Luhang Wang
>
> > Does anyone know whether Stata stores the number of unique values
> > after command -codebook- in any built in macro, just like r(mean) for
> > mean after -sum-?
>
> *
> * 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/
>
*
* 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/