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

RE: st: Re: polychoric


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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 
n.j.cox@durham.ac.uk 

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:
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index