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
integrated time dependent area under the curveHello Is there any command in stata to calculate the integrated time dependent area under the curve…
Merged data is incorrectDear everyone, I really hope to get your advice. I am merging two dta files using command: merge 1:…
what does this mean?Number of obs = 20 F(3, 16) = 31.78 Prob > F = 0.0000 R-squared = 0.8438 Root MSE = 4.8689 -----…
Converting incident data to weekly ratesHi, I've got a data handling challenge that I was hoping to get some assistance with. The data I'm …
Problem with a program that will open a dataset with a user defined list of variablesHi all, I'm creating a STATA program that will: 1. open a dataset, 2. keep a user defined list of v…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable by using a string variable in STATA
Post a Comment