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
create a complex macroDear all, I want to get three models like this: logistic cancer var1 logistic cancer var2 logistic c…
How to conduct multiple impulation when all variables have missing values?Dear all, I am working with my resident survey data (n=8356) including 59 items, most of which are …
SEM Builder: Wrong modelHi, I am trying to run a first-order four-factor model in Stata 15 SEM Builder: Array However, the …
Strong Correlation of Variables in Spearmans'rho MatrixHello Just before doing a panel regression, I wanted to look at the correlation matrix for the desc…
The krls command and panel data regressionsHello Forum members, I have come across the krls command for Kernel-Based Regularized Least Squares…
Subscribe to:
Post Comments (Atom)
0 Response to Creating Variable based on NAIC Digit Level match for Firms
Post a Comment