Hi everybody!
I'm looking to create a Modified Herfindahl-Hirschmann Index (MHHI) in STATA from the attached formula. It creates a market index that also take into account cross ownership of the companies in the sector. I have all the variables I need to execute the formula, I just simply have no idea how to do it in STATA.
At first I thought is should use loops to make STATA go through each company (as the formula describes) but i don't know how to make STATA aware of the relationship between the owners and companies, creating that kind of sumproduct that the formula prescribes for each owner in the company.
All inpust will be well appreciated!
Below is a some of my sample data (highlighted is the name of the variable in the formula):
input byte(Company_number_j Owner_number_i) double(Owner_share_gamma Market_Share_s)
1 1 .29 .2996783902352667
1 2 .12 .2996783902352667
1 3 .29 .2996783902352667
1 4 .29 .299678390235267
2 5 .5 .0466357542171158
2 5 .5 .0466357542171158
3 1 .29 .48362543478072323
3 2 .12 .48362543478072323
3 3 .29 .48362543478072323
3 4 .29 .48362543478072323
4 6 .05 .17006042076689426
4 7 .11 .17006042076689426
4 8 .73 .17006042076689426
4 9 .11 .17006042076689426
The formula:
Array
K is the other companies and therefore when j=1, k=2 then 3 then 4
The formula requires a triple summation but i think breaking it down into single summations will be an advantage.
Related Posts with Calculating MHHI with triple summation
TABSTAT: How to group my summary statistics?Hello together. I need help and search for a simple way to "group" my summary statistics. My curre…
Troubleshooting - Temp file does not find a variableGood evening everyone. I have the following code Code: use "Dataset.dta", replace drop if 5*365&g…
Nested Variables in glmI am trying to use nested variables in glm because I have a non-normal dependent variable potentiall…
Studentized / Standardized ResidualsIs it possible to obtain predicted studentized (jackknifed) or standardized residuals with robust/cl…
How to calculate ten-year moving average of variable x by the dummy variable europe in a dataset as the following? Many thanks! Code: * Example generated by -dataex-. To install: ssc install dataex clear input float id_number i…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating MHHI with triple summation
Post a Comment