Hi, I want to create a binary variable that =1 if an observation within var1 contains certain substrings. It is survey data, and I am looking for a particular word, however, it is often misspelt, so I am looking to search for all possible spelling combinations.
I am using:
foreach word in xx xy xz { egen `word' = incss(var1), sub(`word') insensitive } Which works, but it creates a separate variable for each combination, I only want to create one variable for each variation of the spelling. Thanks.
Related Posts with How can I create one binary variable that =1 if an observation contains one of multiple substrings?
Generating variable that contains (partly) the value of another variableHi everyone, I am currently working with M&A-data and I came across a challenge. I have construc…
Instrumental variables for multilevel data.Good morning, I am writing to ask you a question about the use of instrumental variables if my data…
nlcom: Maximum number of iterations exceededHello everyone, I used nlcom to estimate marginal effects after craggit and I keep getting this err…
Panel data formatHi I would like to transform my panel data so that the years are grouped from 1989 to 2016, consecut…
Principle Component Analysis: using weights and comparison of PCA between countriesHello Statalist Forum Users, We wish to summarize several dichotomous variables of individual level…
Subscribe to:
Post Comments (Atom)
0 Response to How can I create one binary variable that =1 if an observation contains one of multiple substrings?
Post a Comment