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?
Space between axis and line chartHi, I have dataset starting in Febuary 2020 but when I create a chart for some reason the x axis sta…
Problems with Interval RegressionTo whom may offer me help, I would like to run "intreg" since my dependent variable is an interval …
Single and Quadratic function in one loopDear Experts, I need you advice on the possibility to loop 2 codes into one. One is quadratic funct…
LSDV and collinearityHi everyone, I am having trouble implementing a simple least square dummy variable (LSDV) model. The…
add group axis label to chartHi there In chart options, is there a way to add a second group axis label? Example below (year and…
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