Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Category sizes in IF statements - how?
From
Jan Fredrik Hovden <[email protected]>
To
[email protected]
Subject
st: Category sizes in IF statements - how?
Date
Mon, 28 Feb 2011 19:41:18 +0100
Is there a simple way to use the size of a category as a condition of an IF statement?
Take for example the variable AUTHOR, which includes about 1000 different authors. I would like to make a dummy for some of these authors (using either TAB,GEN() or DUMMIESLAB - but not for everyone, only for categories including at least 40 persons.
IN OTHER WORDS: What I would like is to do something like this (written in English):
. dummieslab AUTHOR if categorysize>20
I would greatly appreciate any idea f.
Jan Fredrik Hovden
Associate professor, Department of Information and Media Science
University of Bergen, Norway
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/