Code:
clear set obs 100 gen id = _n expand 100 gen productivity = runiformint(1,5) generate date = floor((mdy(01,01,2007)-mdy(12,31,2020)+1)*runiform() + mdy(12,31,2020)) format date %td
1. For each id I want to structure the data quarterly (calendar) starting with the first quarter the id is in the data and filling in blank spaces for each calendar quarter until today
2. I want to calculate the current quarter statistics of sum, count, average, standard deviation of productivity and then the cumulative statistics of sum, count, average. and standard deviation
My thought was to first create all of the statistics and then do a fill for the quarters but I am struggling with how to start.
Any help is appreciated
0 Response to Statistics by quarter
Post a Comment