Hello,

I have data which is as below. ISO_O is the country, StartYear and EndYear are the years of commencement and finish of a political leader's reign. I would like to create a panel type structure and also generate a dummy for the years that the leader was in power.


input str4 ISO_O int(StartYear EndYear) float Duration
"ABW" 2017 2019 3
"ARG" 2007 2015 9
"AUS" 2010 2013 4
"AUT" 2016 2017 2
"AUT" 2004 2004 1
end
[/CODE]


Therefore, for instance, for ABW the dummy would be '1' for years 2017,2018 and 2019 (i.e. 3 years, which is indicated by the duration variable too).

Thanks in advance for your help and insights.