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

st: RE: unique values


From   "Steichen, Thomas J." <[email protected]>
To   <[email protected]>
Subject   st: RE: unique values
Date   Tue, 7 Jun 2005 12:08:00 -0400

levels catvar, local(uniqlist)


Thomas J. Steichen
[email protected]
----------------------------------------------------------------------------
  Facts do not cease to exist because they are ignored. - Aldous Huxley
----------------------------------------------------------------------------



> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Stephen R. Hale
> Sent: Tuesday, June 07, 2005 12:01 PM
> To: STATA
> Subject: st: unique values
> 
> 
> Hi all,
> 
> I'm new to the list.  Can anyone direct me to an efficient, 
> preferrably already existing way to get the unique values of 
> a categorical variable into a macro.  The goal is just like 
> creating a "by", but I need to have the unique values list.  
> Let's say I can get the unique values in the macro uniqlist.
> 
> I then want to be able to loop over all unique values in the list
> 
> Foreach uniqval of local `uniqlist' {
>   execute code
> }
> 
> Thanks,
> 
> Steve
> 
> Stephen R. Hale, Ph.D.
> Complex Systems Research Center
> Institute for Study of Earth, Oceans, and Space
> Morse Hall
> University of New Hampshire
> Durham, NH 03824-3525
> Work 603.862.4758
> Fax  603.862.0188
> Home 603.664.4036
> [email protected]
> 
> *
> *   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/
> 

-----------------------------------------
CONFIDENTIALITY NOTE:  This e-mail message, including any  attachment(s),
contains information that may be confidential,  protected by the attorney-
client or other legal privileges, and/or  proprietary non-public
information.  If you are not an intended  recipient of this message or an
authorized assistant to an intended  recipient, please notify the sender by
replying to this message and  then delete it from your system.  Use,
dissemination, distribution,  or reproduction of this message and/or any of
its attachments (if  any) by unintended recipients is not authorized and
may be unlawful.


*
*   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