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
Random slopes for categorical variable (3 groups)Dear Stata experts, I'm trying to fit a random slope model for longitudinal dataset. My dependent v…
Adding test statistic to a table for a first stage IV using esttab and ivreg2Hi, I am trying to get a table of my first stage using ivreg2 and esttab. I would like to add the o…
Error when estimating dsge modelHello everyone, Can someone help me to handle this problem please, "The process is saddle-path stabl…
Tabout: Twoway table of means and sdHi! I'm trying to make a table in Excel (via text-file) with tabout for this syntax: by dichotom: t…
Problem with Fixed effects in Cross Sectional Data RegressionDear STATALIST participants, I am writing to you to ask about fixed effects in cross-sectional data…
Subscribe to:
Post Comments (Atom)
0 Response to keeping soundex started with a specific letter
Post a Comment