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
Same data, same code, same stata version, different computers, different resultsDear all, I am running a production function estimation based on maximum likelihood. The code is as…
Manipulating box plotsGood morning, Is it possible to redefine box plots, for example to have something more meaningful th…
Interpretation Confidence interval including zeroHi, I'm performing a Negative binomial regression (xtnbreg), however, I found that the confidence i…
Panel regression with country fixed effect and panel-robust standard errorsDear Statalist Members: I have some questions about the panel regression with country fixed effect …
plotting durationsDear community, I am trying to visualize some of my data over time and face the following problem: …
Subscribe to:
Post Comments (Atom)
0 Response to keeping soundex started with a specific letter
Post a Comment