Hi
I want to create a new variable (var3) using an existing variable (var2).
Like the attached photo
a, b = 1
c = 2
d, e = 3
I want to make it like this.
How should I use the command in stata 13 ?
It is not necessary to use the "if" command. Array
Related Posts with Generate new variable by command "if"
Mata find minimum distance across matricesDear Statalists, I am very new to Mata and I am trying to solve a problem that involves finding the…
LATE Difference-in-DifferencesHi all, I'm trying to estimate a generalized DID (two periods three groups)'s local average treatme…
Merging datasets with same variable but different values for the variableHi. I wanted to understand the finer working of the -merge- command and it isn't clear to me from re…
Regression results interpretationHello everybody, I am currently doing data analysis and got stuck by the interpretation of my resul…
Stata EGI module issueI am trying to calculate the EGI (Ellison and Glaeser's index of geographical concentration) using t…
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable by command "if"
Post a Comment