Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Marking Levels of Categorical Variable


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   Re: st: Marking Levels of Categorical Variable
Date   Thu, 25 Sep 2008 11:57:18 +0900

bysort var: generate byte more_than_ten = _N >= 10

will work for the ABCDE example (N = 100), but
local N `=_N'
bysort var: generate byte more_than_ten = _N / `N' >= 0.1

is more general, like Friedrich Huebler showed.

Joseph Coveney


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




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