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?
cross-referencing tables produced with esttab in markstatReferencing equations and figures (as described here: https://data.princeton.edu/stata/markdown/cros…
Regarding time-fixed effect in panel regressionI have a basic econometrics concept query. I have a model where the dependent variable is both time …
Multiplicative versus additive IV PoissonI am using the IV Poisson to address the endogeneity issues in my gravity model. However, when I use…
Obtaining standard error for covariance in mixed effect modelDear Statalist, I was wondering if anyone knows how I could obtain the standard error for the covar…
How to test for heteroskedasticity in a panel data-setHello, I have a panel data set with 180 countries observed during the period 2008-2017, I am trying…
Subscribe to:
Post Comments (Atom)
0 Response to How can I check if two string variables contain any same elements?
Post a Comment