I have a dataset which more or less looks like the one provided below. For this dataset, I want to calculate the average number of surveys done per surveyor per weekday and also the average number of surveys done per surveyor per weekend (which for me is only Sunday).
In my dataset:
- variable surveyor_id denotes the ID given to the surveyor.
- variable total_surveys denotes the total surveys done by the surveyor
- variable total_days denotes the total days the surveyor has worked
- variable dow denotes the what day of the week it was. For example, 0 = Sunday and 6 = Saturday.
Please note that weekdays for me would constitute: Tuesday, Wednesday, Thursday, Friday and Saturday and weekend would constitute only Sunday. Monday is a holiday.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(surveyor_id total_surveys total_days dow) 1 4 2 0 2 6 3 2 3 2 1 3 4 1 1 0 5 1 1 4 1 4 2 1 2 6 3 0 2 6 3 5 end
Thank you!
0 Response to Computing average productivity per weekday and weekend
Post a Comment