Hello
I have a series of mortality data for 100 countries.

I have (clumsily) coded the following for the first country:


tssmooth ma Albania_5yrmortality_mean =yearly_mort_Albania, window(0 1 4)
gen ismiss = missing(yearly_mort_Albania)
replace Albania_5yrmean = . if ismiss > (4/5)
drop ismiss



is there a way to repeat this for all countries?

many thanks
Catherine