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
Exporting a tableI have created using a string variable (called CompanyNameCIQ) and an indicator variable (Verfied, w…
Analyzing World Bank Dev, IndicatorsI am working on the attached data and new stata user. Can I get commands for the mean, minimum, and …
How to create a variable equal to the kurtosis?Hello Statalist community, I am currently struggling to achieve the following: I would like to crea…
Estimating EndogenityI am using ivregress 2sls command to estimate endogenity I am using below variables; Dependent vari…
Doubts regarding margins, logarithmics in marginplot and contrastHello! I have some doubts regarding if I am interpreting the results from command margins the corre…
Subscribe to:
Post Comments (Atom)
0 Response to keeping soundex started with a specific letter
Post a Comment