Hello,

I'm using STATA 15, SE.

I'm facing an issue, trying to come up with a way to control for industry fixed effects in my regression and other analysis, but the problem is a firm can belong to several industries at the same time. Meaning, I have this:

firm_id Industry1 Industry2 Industry3 Industry4
A Auto Mining . .
B Auto publishing Telecumincaiton Services
C Mining publishing Services .
D High-Tech Services . .
As you can see, firms can have multiple industry classifications, and once they do, it is in alphabetical order.

I'd like to be able to control for industry, such that each firm that is represented in that industry will be included. Meaning, if I run the regression:

reg y x i.industry

All firms that are in the Auto industry are given a coefficient, all firms in the mining industry are given a coefficient, and so on.

Another way to think of this is to say I run the following command:

bys industry: sum XXX All firms that are in the Auto industry are given a coefficient, all firms in the mining industry are given a coefficient, and so on.

I couldn't find an answer to this question so I would really appreciate your thoughts on this.


Thank you.