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!
Related Posts with Expanding dataset by one year keeping all values but changing one
Difference between clustering and fixed effects/adding control variables into the regressionI have observational data that was collected within the same year but on different days and in diffe…
Generating difference in meansHi all, I'm trying to solve what is likely a fairly easy problem but is tripping me up. I want to ch…
New Stata seminars and Structured Program on semHi everyone I wanted to let you know about some new Stata seminars that we're running in August thr…
ranking observations within a grouphow can i rank observations within a group? if i use the code: egen rank=group(var1), by(var2). i ge…
Sample Size using mcnemar test for two dependent binomial populationsHi Statalist users I need your help in estimating the sample size for an interventional study wher…
Subscribe to:
Post Comments (Atom)
0 Response to Expanding dataset by one year keeping all values but changing one
Post a Comment