For example, X is a variable
X
123
234
35
67
82
Now the values are saved as strings. If I want to create a new variable Y where
Y = 1 if X contains the number 2
Y = 0 if otherwise
How to do this on STATA?
Related Posts with Creating a new variable by using a string variable in STATA
Matching one variable with another variable from different datasetHello, I have a large dataset, with 2.800.000 observations and 10 variables aproximately, and I wou…
Expression too long error while finding synthetic controlDear all, I am using Stata 15.0 to find a synthetic control group using synth command. No matter ho…
Anyone familiar with unit root test(s) with multiple breaks?Hi, I would like to test a time series variable for unit root. I have one model with 4 impulse dumm…
Difference-in-difference with same group but three time periodsHello Statalist community. I have a question regarding a difference-in-difference regression I want…
Checking one variable with another variable from different datasetHello, I have a large dataset, with 2.800.000 observations and 10 variables aproximately, and I wou…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable by using a string variable in STATA
Post a Comment