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?
Stratifying in logistic regressionHello, I am attempting to conduct a logistic regression and I want to stratify by a group that I hav…
Box plotsHi all, I am quite stuck in plotting a proper box plot with STATA. The following is the plot result…
Repeated Measures DuplicatesI have a longitudinal dataset with a studyid visit_date refill_date adherence and stage I have multi…
Zoom in a mapDear listers, I have a problem in visualising information on the map. After I creates a map, the ma…
GINI calculation using inequal7Good morning, I am interested in calculating the potential differences in the gini index for networ…
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