Hey,

I'm working with a dataset that contains the following variables: year, country (all country names are strings), countrycode and some variable etfra which measures ethnic fractionilization. The data set starts in 1990 and ends in 2013. What I need to do is to expand the set to the year 2014 for each country and using the median of the years 2009-2013 to fill in the ef_etfra of 2014. Im not entirely sure how to approach this, tried different things using a foreach loop but they all were quite unsuccessful. I'd be thankful for any hint or concrete code suggestion. Thanks a lot in advance!