Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73256

Defining value labels based on varlist

$
0
0
Dear all,
I am writing a program which at the beginning I define a varlist:

syntax varlist (min=3 numeric) [if] [in],…….

Then at some point I have:

gen ID=_n

Next, I need to define the value labels for the new variable ID, but I want the value labels to be the name of the variables in the `varlist’. Meaning that I want 1 to be labeled “var1”, 2 to be labeled “var2”, and so on.
Any help would be appreciated.
Noori

Viewing all articles
Browse latest Browse all 73256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>