Hello Stata Community,

I am trying to compute the growth rates of gdp per capita per country as shown below. How can this be done in Stata?

Furthermore,I am trying to compute 5-year non-overlapping average growth rates from gdp per capita on an unbalanced panel.
The five year framework starts from 1990 to 2018(so, 1990-1994 ;1995-1999 and so on).
Since my dataset is unbalanced, i choose to take the 5-year average if the number of observations is at least 3 within each 5-year period.How can this be implemented in Stata?

Moreover, I also have public spending variables as shown below. How can I use Stata so that all the public spending items take the initial values in each period/framework?

Thank you for your help!

KR,
KD
My data looks as follows(as an example):

country year gdp_pc educ_exp health_exp ............
Ireland 1990 5465 13% 5%
Ireland 1991 4545 8% .
Ireland 1992 7536 4% 7%
​​​​​​​Ireland 1993 8526 6% .
​​​​​​​Ireland 1994 9635 . .
​​​​​​​​​​​​​​Ireland 1995 . . .
​​​​​​​Ireland 1996 4%
​​​​​​​Ireland 1997 .
Malta . . . .
​​​​​​​Malta . . . 5%
​​​​​​​Malta . . 6% .
​​​​​​​Malta .
​​​​​​​Malta . . . .
.
.
.