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
How to detect data entry error: locating an observation that does not match any of the observations of a given set?Hi Statalist, Apologies for the vagueness of the question as I didn't know how to frame it better. H…
generalised DID with two-way fixed modelDear researchers, I have unbalanced panel data for a set of firms for the year extends from 2000-201…
Standard deviation of annual changes in log-sales over the recent five yearsHi, I would like to calculate the standard deviation of annual changes in log-sales over the recent…
Estimating discrete choice model using continuous v/s binary variablesHello, I am trying to estimate a discrete choice model, and I have a quick question on how I can st…
find robustHow can I solve the following error? must specify panelvar; use xtset r(459); …
Subscribe to:
Post Comments (Atom)
0 Response to Need help with Mean for Grouped Data
Post a Comment