Array
Good morning Stata Family,
Please I want to create a new variable for the average wage earned by each worker for B and C shifts alone (as seen in the image above).
The code that I know: egen avgwage = mean(wage), by workerid gives me the average wage using all the shifts. I just want to find the average for just the B & C shifts, which I intend to use as a control for my analysis.
Any guidance you can provide will be most appreciated.
Thank you!
Related Posts with Need help with Mean for Grouped Data
Help with standard deviations of oaxaca commandDear all, I'm trying to replicate the results of the oaxaca9 command manually, but I have problems …
Testing the OLS assumptions in relation to standard robust errorsDear all, I'm testing the OLS assumptions for a multiple cross-sectional regression model. In rela…
Staggered difference in differenceDear Statalist Community, I am experiencing studying the impact of the introduction of body cameras…
Problem with similar equation (gen)Hello everyone! I am new in this forum. I face a problem with the following: When I write gen Demp…
Compute covariance and store in columnMy data are the following. I want to compute the covariance of dclose and dclose_lag for each ticker…
Subscribe to:
Post Comments (Atom)
0 Response to Need help with Mean for Grouped Data
Post a Comment