Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: xi help


From   moleps islon <[email protected]>
To   [email protected]
Subject   st: xi help
Date   Thu, 27 Aug 2009 13:30:42 +0200

In case anyone have the same needs, this program seems to do what I want:

capture program drop tabgen
program tabgen
syntax varlist

tokenize `varlist'

foreach var of local varlist{

	 qui levelsof `var', local(`var'_lev)
	 foreach val of local `var'_lev {
      	
		gen _`:label `var' `val''=`var'==`val'
	}
 }
end


Enjoy,

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