I am fairly new to STATA, and need to create a moving average for my data. (I cannot use tsset for this data). I am trying to do something like:
gen ma = education if year==19301 + education if year==19302 + education if var==19303 + education if year==19304 / 4

(So i have four years of data I need to find the average of)
I have 40 years of data, and I don't mind if I set up the moving average equation 40 times, but I can't get any form of equation to work.
I am doing a moving average of education by year. How can I do this? Thanks!