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

RE: st: Re: polychoric

From   "Nick Cox" <>
To   <>
Subject   RE: st: Re: polychoric
Date   Mon, 2 Feb 2004 22:05:07 -0000

An advantage of that would be that -inspect- 
is part of the executable, so will 
run very fast. On the other hand, it does 
other things too. 

Alternatively, a calculation for 
# of distinct values might go something like this: 

marksample touse 
tempvar unique 
bysort `touse' <varlist> : 
	gen byte `unique' = `touse' * (_n == 1)  
su `unique', meanonly 
local n_unique = r(sum)  

What goes faster? Possibly -inspect-. 


Nick Winter
> You might be able to make good use of the -inspect- command; 
> when run on a 
> single variable, it seems to leave behind the number of 
> unique values in 
> r(N_unique)

*   For searches and help try:

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