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?
Interpreting logistic regression "Odds ratio ouputHello everyone I am investigating the factors that influence Adherence Pre-Exposure Prophylaxis (Pr…
Cox Proportional Hazards Model with multiple failure events and panel dataI would like to use a Cox Proportional Hazards Model to estimate the hazard rate of an individual in…
LoopsHi, I have the following code : egen identifier = group(isin) sum identifier scalar max2=r(max) lo…
Problem with time series: repeated time values within panelHi, I want to create a time series variable, but when I enter the commend tsset date, I receive the …
granger causality_second timeHello everyone I tried many times to run granger causality test but i got HTML Code: repeated time…
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