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
How do you maintain your library of code sinppets?This question is for anyone whose programmed for long enough to find that keeping snippets of code t…
Difference between vce(cluster) and vce(bootstrap)?I'm using a fixed effects model. When dealing with heteroscedasticity and autocorrelation, I'm not s…
Problem encoding dates: unordered valueHi all: I am gettings problems when I encode a date variable, to explain my problem I will use this…
New version of -ranktest- available on SSCWith thanks to Kit Baum, a new version of ranktest by Kleibergen-Schaffer-Windmeijer, version 2.0.03…
Probit marginal effectsI estimated the following probit model: Code: probit enrolled i.male##c.wealth i.male##c.oppcost h…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable by using a string variable in STATA
Post a Comment