I have a file that contains data on the number of people that enrolled in a health plan each month by age group, race, etc. The file has the columns: date, race, age group, and number of enrollees. I want to calculate the average monthly enrollment for each quarter (NOT the quarterly average, which will be a much bigger umber) to later use it as denominator in a calculation of service utilization rates like this:
average number of monthly visits to a doctor divided the average monthly enrollment in a health plan.
I have tried calculating moving averages but don't know how to specify the right set of months within a quarter.