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
Spmatrix command and its memory needDear All, I am using Stata 16. I try to run spatial regressions with sp commands. I am using an eco…
egen concat including if functionI have a very simple issue, and I read some help material but can't quite solve it. I want to create…
significance of dynamic multiplierhow can we understand that dm is significant by looking at dm table? below figure is taken as an exc…
Dropping excess character - String variableDear All, I have a string variable which captures the ICD-10 codes. However, some of the codes have…
Reading multiple files with infix #delimHi, I am a beginner in Stata, and I'm trying to do read a number of files to form a dataset (and pos…
Subscribe to:
Post Comments (Atom)
0 Response to Need help with Mean for Grouped Data
Post a Comment