Dear Forum,
I have the following very basic problem. Unfortunately, I couldn't find an appropriate solution in the forum. so please correct me in case there`s a thread out there already.
My dataset is structured as follows:
ID year industry state X Y
2 2010 0K70 1 1.9e+07 1.4e+09
2 2011 0K70 1 3.7e+07 1.7e+09
6 2010 0K70 1 2.5e+06 3.5e+07
6 2011 0K70 1 2.5e+06 4.3e+07
8 2010 0F51 0 270000
8 2011 0F51 0 624000
9 2010 0S90 0 4.8e+06 3.2e+07
9 2011 0S90 0 5.1e+06 2.1e+07
I want to calculate the variable Z constructs a pay gap benchmark using "non-state" observations. which Specifically shows the average pay gap of non-state in each industry-year, and then compares the "state" pay gap in the same industry year with the non-state industry-year average.
( Z ) is calculated using the following formula :
Z = average_ Non_state_paygap j,t - state paygap i,j,t
where: Average Pay Gap_Non_SOEj,t is the average pay gap calculated for industry j in year t using Non-state. PayGap is the ratio of the average X to the average Y, and it is calculated for state and non-state firm-year observations, respectively.
Any help would be highly appreciated, thank you in advance.
omer
Related Posts with generate variable on the basis of industry year and firm
gsem for latent class analysis_not concave issueHello dear Stata users, I want to run a latent class analysis with 37 variables and approximately 7…
Question about spregdpdDear all, After we use xtabond or xtabond2, we can use "estat serial" to get AR(1) and AR(2) .But if…
Selecting a subset from a balanced panel data under certain conditionsDear all, I need some help. Well, I have a database in the structure of a balanced panel. I have to…
Transforming Quarterly Variables into Annual Variables - British Labour Force SurveyHi everyone, I am working on the British Labour Force Survey (LFS) data to explore the effects of m…
Loop command to generate 100 variables with mean 0 and standard deviations which increase from 1 to 100 How i can use the loop command to generate 100 variables var_1 to var_100, which are normally dist…
Subscribe to:
Post Comments (Atom)
0 Response to generate variable on the basis of industry year and firm
Post a Comment