Baselight
select 
  congress,
  datepart('year', termstart) as year,
  party,
  ROUND(median(age), 1) as "median age", 
  ROUND(mean(age), 1) as "mean age"
from @fivethirtyeight.congress_age.congress_terms
where year >= 1980 and party = 'R'
group by congress, year, party
order by year
congressyearpartymedian agemean age
971981R4948.3
981983R50.449.7
991985R51.750.5
1001987R51.951.3
1011989R52.952.5
1021991R54.754
1031993R52.853
1041995R51.651.8
1051997R51.652.3
1061999R53.154
1072001R53.654.2
1082003R54.354.7
1092005R55.355.8
1102007R56.356.9
1112009R56.656.9
1122011R55.455.3
1132013R56.155.8

Share link

Anyone who has the link will be able to view this.