I am currently investigating wage differentials by industry in Germany. My dataset gives me cross-sectional data per individual, with information such as industry, wage, etc. To find the uncontrolled wage differentials per industry, I ran the following command:

reg lnwage i.industry

Stata then returns coefficients for each industry (which represent the wage differential of that industry). I now wish to calculate the employment-weighted mean differential. I obtain the number of employed people in each industry with the following command:

tab industry

Now, I want to weight each coefficient obtained from the regression by its frequency, to get the weighted average differential across all industries. For example, if the industry "Farming" has a coefficient of 0.4 and employs 30% of individuals, while "Mining" has a coefficient of -0.2 and employs 70% of the individuals, then the employment-weighted mean differential is (0.4 * 0.3) + (-0.2 * 0.7) = -0.02

Ideally, I then want to present the difference between each industry's coefficient and the employment-weighted mean differential in a table.

Does anybody have an idea how I can execute this?