Hello everyone! I need to calculate the value of the (1) standard deviation and the (2) average (both separated) per sector, using the following variables: RB, Sector and time. Could someone help me on how to do it?

quart --------ID -----RB --------- Sector
2016q1 -- AAL -- 1000.00 --Cheers
2017q2 -- AAL -- 4000.00--Cheers
2018q3 -- AAL -- 2000.00 --Cheers
2019q4 -- AAL -- 6000.00 --Cheers
2016q1 -- LRC -- 1000.00 --non-cyclical
2017q2 -- LRC -- 5000.00 --non-cyclical
2018q3 -- LRC -- 8000.00 --non-cyclical
2019q4 -- LRC -- 9000.00 --non-cyclical
2016q1 -- AUB -- 1200.00 --Industry
2017q2 -- AUB -- 1500.00 --Industry
2018q3 -- AUB -- 6900.00 --Industry
2019q4 -- AUB -- 6900.00 --Industry
2016q1 -- CLC -- 1000.00 --IT
2017q2 -- CLC -- 4000.00--IT
2018q3 -- CLC -- 2000.00 --IT
2019q4 -- CLC -- 6000.00 --IT
2016q1 -- PPA -- 1000.00 --non-cyclical
2017q2 -- PPA -- 5000.00 --non-cyclical
2018q3 -- PPA -- 8000.00 --non-cyclical
2019q4 -- PPA -- 9000.00 --non-cyclical
2016q1 -- RRR -- 1200.00 --Industry
2017q2 -- RRR -- 1500.00 --Industry
2018q3 -- RRR -- 6900.00 --Industry


I already used the command "summarize", but the result was consolidated.
Used: egen sd RB = sd (Sector), by (ID quart) - but there was an error.