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
First differences - Ordered ProbitHi, I have a dataset (T=2 and N=4300 (2300 in the first wave of which 2000 panels are present in the…
appending tables with the collect commandDear Stata Forum, I am just starting to experiment with the new "collect" command, and I am having …
Repeated Cross sectional regression commandsHello guys, I am working on repeated cross sectional data sets on women (health related) for 36 coun…
?Longitudinal analysisI am working on some clinical data looking at echocardiographic features of patients after surgery. …
twoway rspike: how to make the spike it appear vertically in the legend?Dear Statalisters, please let me know if there is already a thread about this - I did not find one.…
Subscribe to:
Post Comments (Atom)
0 Response to Creating Variable based on NAIC Digit Level match for Firms
Post a Comment