Hi Statalist member.

This is probably a pretty easy question to answer but I did not find a proper solution to this and hope some could help.

We have panel data for 10 years and 16 countries on labour productivity, and want a table to compare the between country standard deviation for each year, so we can see the development of the standard deviation over time.

I have used the command xtsum productivity and get the between country standard deviation for the whole period, but I would like to get it year by year.

Example of data:
Code:
country    year    productivity    countrynum
Austria    2015    164.8385    1
Austria    2016    168.6326    1
Austria    2017    172.5153    1
Austria    2018    176.4886    1
Austria    2019    180.5546    1
Austria    2020    184.7156    1
Austria    2021    188.9738    1
Austria    2022    193.3315    1
Austria    2023    197.7912    1
Austria    2024    202.3551    1
Belgium    2015    107.6414    2
Belgium    2016    107.9399    2
Belgium    2017    108.1758    2
Belgium    2018    108.346    2
Belgium    2019    108.4477    2
Belgium    2020    108.4778    2
Belgium    2021    108.4335    2
Belgium    2022    108.3119    2
Belgium    2023    108.1101    2
Belgium    2024    107.8255    2
Czech Republic    2015    79.43179
Czech Republic    2016    81.03962
Czech Republic    2017    82.54955
Czech Republic    2018    83.94523
Czech Republic    2019    85.20939
Czech Republic    2020    86.32392
Czech Republic    2021    87.27002
Czech Republic    2022    88.02835
Czech Republic    2023    88.57927
Czech Republic    2024    88.90311

How we would like the output to look like:

Year between SD
2015 25,2
2016 26,0
2017 26,5
etc.

Thanks for your attention.