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
adjusted R-squared using area versus reghdfeDear Statalist community, I have a model that controls for many fixed effects and clustered standar…
SEM with count, binary and continuous endogenous variablesGood Evening, I am new to SEM in stata. I have the following path diagram, in my empirical dataset,…
Help with Frequency TablesHello, I have a dataset with nations and studies. I'm wanting to create a frequency distribution wh…
suest and teffects togetherHello All, I am trying to use suest command after effects. use http://www.stata-press.com/data/r13/c…
Change format of elapsed time from seconds to mm:ssI have 1.5 mile run times recorded in seconds. I would like to keep this variable as seconds for the…
Subscribe to:
Post Comments (Atom)
0 Response to keeping soundex started with a specific letter
Post a Comment