Hi all,
I have a question about comparing two string variables. I wanted to compare the values of these variables row by row, to see if they contain any same elements. That is to say, for each row, they do not need to be exactly the same. As long as they have at least one same element, then the dummy variable indicating same elements should be 1 (it would be better if the number of same elements can be reported). For example, for the first row, if the value of var1 is A,B, and the value of var2 is A,B,D. Then, the value of the dummy variable is 1 since they have two same elements, A and B. How can I realize this using STATA?
Thanks for your answer in advance!
Best,
Yongli
Related Posts with How can I check if two string variables contain any same elements?
Optimal lags and Error-correction modelGood morning everyone; I want to perform a cointegration with the Error correction model. Everythi…
How to set the X axis in the DASP package in stataI want to use the DASP plug-in in stata and use the Lorenz curve to analyze the fairness of inter-pr…
cmp-random effectsGood day, I am trying to estimate the impact of health status expectations (Exp_h) on consumption ex…
Business calender: Get omitted dates using bodf()I have a list of dates for specific company events of listed US companies. This variable (reguldate)…
putdocx cell / row heightIs there a way to control the row or cell height in a putdocx table? …
Subscribe to:
Post Comments (Atom)
0 Response to How can I check if two string variables contain any same elements?
Post a Comment