Hello,

I am looking for a function to calculate the average unemployment rate (mean) over two sets of years (2007-2011) and (2012-2020) for various regions defined by the variable 'regionid'. For the years I have produced a dummy variable 'post' where post=0 if year <= 2011 and post=1 if year > 2011.

I have tried the following functions but I am having difficulty in combining them into one function which incorporates both post and regionid.
tabstat ur, stat(mean) by(regionid)
tabstat ur, stat(mean) by(post)

I am looking to create a table like this using STATA.

Could someone please guide me in finding the right command.

Array
Thank you.