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
How to find nonnumeric characters within a string variable and lists the observations that have this issueI want to identify which observations in my variable has non-numeric characteristics and what is the…
changing numeric string to numeric variable where e5 next to a number means 10^5I have a string variable of the type show below, where 63e5 represents 6300000. How do I change it 6…
Crosstabs automationI am in the process of fully automating a code process. i have 10 different variables and first i ha…
Interpretation of probit post-estimation testHi Statalisters, I have a question about interpreting post-estimation tests in Stata. Suppose I est…
An indicator variableHi everyone, I have a dataset including over 500 firms that have CEO changes based on CEO_ID and la…
Subscribe to:
Post Comments (Atom)
0 Response to Defining value labels based on varlist
Post a Comment