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
Converting R date into STATA dateHi, I am trying to convert R dates into STATA dates but unable to do so. For example, the R date i…
calculate averages of groups of observations separated by groups of missing observationsHi everybody, I have panel data with a few variables that have a somewhat random pattern. I need to…
Mark all observations that has one variable in commonHello, I'm quite new to stata. I have searched in this forum, but can not find the answer I need, th…
How to Append .txt fileHi, how can I append a dataset with another using files that are in .txt format? I tried to use the …
gsem mlogit: set base categoryHi, I've estimated a latent profile analysis in Stata 17.0 with three continuous dependent variables…
Subscribe to:
Post Comments (Atom)
0 Response to Defining value labels based on varlist
Post a Comment