Hello everyone,

I have panel data with several countries countries over a specific time period. Now I want to generate a new variable which takes the value from a specific year for all years. For example: I have GDP data from 1970 to 2010, and I want to generate a variable that takes the GDP value from 1980 for all years (by country).

I already know the command
bys id: gen gdp_ini = gdp[11]
,

but since not all countries start in the same year I want to tell Stata to use the GDP value from year=1980. Any suggestions? Help would be highly appreciated!