I have a list of firms that I am comparing to each other. Next I want to compare the NAIC code of each firm_id to each firm_id2 on each digit of the 6-digit level NAIC code. If the digit is the same, I am saying they are similar at the "X-level."
I am also trying to determine if the region is the same (same_reg) among two firms - do I generate another variable firm_id2 and then see if region matches across each firm?
Data:
firm_id M_Acq_Naic M_Acq_Reg
1 511210 "JP"
2 236116 "EU"
3 451120 "AM"
3 451120 "AM"
3 451120 "AM"
3 451120 "AM"
4 441110 "AM"
4 441110 "AM"
5 811310 "EU"
6 221119 "EU"
7 813212 "JP"
where similarity between firm 1 and 2 is 0. But similarity between firm 2 and 6 is 1 (first digit) and firms 6 and 8 are similar at the 2-digit level so similarity will be equal to 2.
where same_reg between firm 1 and 2 is 0 but is 1 between firms 3 and 4.
Thanks in advance for your help!
Related Posts with Creating Variable based on NAIC Digit Level match for Firms
GLM or Tobit Regression & Forecast for different distributions (incl. zero inflation)Dear Statalists, I'd very much like to hear your opinion on the following. What I’m trying to do: …
Implementing Wild Bootstrap T Standard Errors in Regression OutputHello everyone I am investigating the effects of an exogenous economic shock on the unsecured credi…
Unbalanced panel data analysisHi dear all i hope you all fine ...i am undergoing a problem in running analysis on the data ,the de…
GLM model with Gamma distribution and log link - residualsDear all, I am new to running the GLM model in Stata. I have healthcare data which is positively ske…
Interactions, Inconsistent resutlsHi all,, I am getting inconsistent results and hope that someone can help me understand the source.…
Subscribe to:
Post Comments (Atom)
0 Response to Creating Variable based on NAIC Digit Level match for Firms
Post a Comment