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.
Related Posts with Year Dummies for a duration
Forced variables dropped when using lassoDear Stata Users, I am running a regression through the lasso command in Stata 16. My aim is to use…
Matching data with different time intervalsDear Statalist, For my research, I need to link accounting data with stock price data (both from WR…
6-month Cumulative ReturnDear Statalists, I know there are couple of posts about cumulative returns but unfortunately none of…
Foreach regression loop - Stata 16Hi, I am trying the 'foreach' command for the first time and cannot figure out the problem in my cod…
Region dummies in fixed effects panel analysisHello, I am very new to both statalist and statistics in general, so I apologise in advance for my v…
Subscribe to:
Post Comments (Atom)
0 Response to Year Dummies for a duration
Post a Comment