I have a dataset and want to keep a number of variables - Soundex started with a letter, for example, those which started with "H" like H0028. The variable's name is "contractid" and I want to keep only those started with H or R or E
I used the following command but it doesn't work
keep if substr(string(contractid), 1,5) == "H" | substr(string(contractid), 1, 5) =="R" | . substr(string(contractid), 1,5 )=="E"
I would greatly appreciate your help
Related Posts with keeping soundex started with a specific letter
Creating start and end variablesHello, I would like to create start and end variables according to the data collection wave in which…
drawing normally distributed random variable within an intervalHello everyone, How can I create a normally distributed variable within [a,b], with HTML Code: me…
xtlogit with cross-autocorrelationDear all, I start my project with panel data and xtlogit command. In the case of presence of seria…
Identify observations with identical values among a group of variablesHi, Could you help me how I can browse only those observations containing similar values at least i…
Interpreting (normalized) dummies in explained component oaxaca-blinderI am looking at the health gap between indigenous and non-indigenous Canadians and am unsure on how …
Subscribe to:
Post Comments (Atom)
0 Response to keeping soundex started with a specific letter
Post a Comment