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

st: RE: xi help

From   "Nick Cox" <>
To   <>
Subject   st: RE: xi help
Date   Thu, 27 Aug 2009 15:33:44 +0100

you didn't edit out all previous postings, but kept relevant material.
Also: use your mailer to reply, rather than sending new posts.] 

The possible issue here is that value labels in general need not be text
that qualifies as (not yet existing) variable names. Moleps knows that
his value labels are OK, but that need not be true in general. 

Either way, this problem has already been addressed in the program
-dummieslab- from SSC. -ssc inst dummieslab- to get a copy. Moleps, or
anyone else interested, would have seen a pointer to that if they had

. findit dummies 


moleps islon

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

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'

*   For searches and help try:

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