Hello dear Stata users, i'm writting my master thesis and using Stata for econometric analysis, but the problem is that i have zero experience with the software.
My data looks like the one shown below and my problem is that i don't know how to create a variable that shows the company's duration on a given status, in this case, Exporting Status = 1. In concret, i need a variable that tells me the consecutive number of years that a company was able to export (regardless of the year it started) until there is a failure, which means, Exporting Status = 0.
Can anyone help me? Thank you for your attention. Cheers
My data looks like the one shown below and my problem is that i don't know how to create a variable that shows the company's duration on a given status, in this case, Exporting Status = 1. In concret, i need a variable that tells me the consecutive number of years that a company was able to export (regardless of the year it started) until there is a failure, which means, Exporting Status = 0.
Can anyone help me? Thank you for your attention. Cheers
Company's ID | Year | Exporting Status | Duration | |||
PT500000026 | 2008 | 1 | ||||
PT500000026 | 2009 | 1 | ||||
PT500000026 | 2010 | 1 | ||||
PT500000026 | 2011 | 1 | ||||
PT500000026 | 2012 | 1 | ||||
PT500000026 | 2013 | 0 | ||||
PT500000026 | 2014 | 0 | ||||
PT500000832 | 2008 | 0 | ||||
PT500000832 | 2009 | 0 | ||||
PT500000832 | 2010 | 1 | ||||
PT500000832 | 2011 | 0 | ||||
PT500000832 | 2012 | 0 | ||||
PT500000832 | 2013 | 1 | ||||
PT500000832 | 2014 | 1 | ||||
PT500001499 | 2008 | 1 | ||||
PT500001499 | 2009 | 0 | ||||
PT500001499 | 2010 | 0 | ||||
PT500001499 | 2011 | 1 | ||||
PT500001499 | 2012 | 1 | ||||
PT500001499 | 2013 | 1 | ||||
PT500001499 | 2014 | 1 |
Comment