Dear all,

Im currently working with a panel datatset covering automation risk on occupational- and country-level.
As potentional instrument I would like to use the average automation risk of surrounding countries.
Therefore I need to generate a variable that would calculate the mean of the surrounding countries automation risk, by each year for each country (which has a different set of surrounding countries)
Sadly I have been unable to find a solution for this as of yet

Thanks in advance