st: Monthly observations to quarterly averages

I have a dataset of unemployment rates by state by month and would
like to convert these into quarterly averages, so I'd like to take the
mean of every three observations and store it as a separate variable.

AK 99 Oct 0
AK 99 Nov 5
AK 99 Dec 10

would yield a value of 5, tied to that quarter. I'm imagining that
collapse is the command I want to use, but am having trouble finding
an example of this kind of process.