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
Advice on changing data to split sample into size categoriesHello everyone, I have a panel data set with data on the investments of German firms into other cou…
Predicting standardized residuals after mlogit (multinomial logistic regression) using svyset?Dear users, I kindly ask for your guidance regarding my following problem: I am conducting a multin…
Fill missing values with means using mipolateDear Statalists, I would like to fill missing observations in a panel. I found the mipolate command…
Output interpretation diffDear Statalist, I am running a Difference in Difference analysis for a policy effect on employment …
3D graph with spikesDear Statalisters, I have been trying to produce a 3D graph for my data below. Array Code: * Examp…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable by using a string variable in STATA
Post a Comment