Hi
I have a panel data set with T=30 and N=15
I want to calculate rolling growth rate for 5 years

I know that growth rate can be calculated using the following two options as mentioned in previous posts (for example https://www.stata.com/statalist/arch.../msg00664.html)
Code:
 by id: g growth=(gdp[_n]-gdp[_n-1])/gdp[_n-1]   
 ​​​​Or   
  D.(loggdp) (which is more like change
I think the first option is what I need however I am not sure how to adjust for the rolling window. Any suggestions will be appreciated Thanks