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
Related Posts with Defining value labels based on varlist
Question about cumulative incidence plotDear Stata specialists, I have some questions of how to draw cumulative incidence plot using Stata.…
-coefplot- for treatment effectsHello, I ran treatment effects regression adjustment (-teffects ra-, pomeans aequations) and now I …
Storing odds ratio and p-value in logit and ologit from multiple variablesHi everyone! I have 10 dependent variables (y1-y10) and 4 independent variables (x1-x4) with x1 as t…
Creating a new variable with date and time togetherHi, I am trying to create a new variable that has the date (bedtime_date) and time (q4_time_outofbe…
Obtaining individuals' ages from their dates of birthHi all. I have data on the socio-economic characteristics of mayors in Brazil in 2004. Please see pa…
Subscribe to:
Post Comments (Atom)
0 Response to Defining value labels based on varlist
Post a Comment