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
qregsel implementationDear members Am implementing the recommendations in this paper https://www.stata.com/meeting/us20/s.…
Comparing GMM estimatesI am trying to write my own GMM program in a different language and want to compare results with Sta…
Problem with -replace- var ... if ... I was suprised to see that the last two commands ("replace new_var = 0 [...] and replace new_var = …
Work without shapefileHi to everyone. I state that I am new to Spatial Econometrics. My data set is composed of 32 gasolin…
Panel data with lagged independent variables and dependent variable only two periodsHi Member, Please, does anyone could help me? I need to lag and lead one independent variable in my …
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable by using a string variable in STATA
Post a Comment