Hello everyone, as the title says, I am having difficulties in understanding how to create a dummy variable based on panel data. My database gathers data about employees’ recruitments and layoffs. The scenario is the following:
As an example of what I am trying to do:
EMPLOYEE_ID YEAR COMPANY_ID HIRING_DATE DISMISSAL_DATE OPEN ELIGIBLE
1 2016 1111 January 1st 2016 . 1 .
1 2018 1111 . June 1st 2018 1 .
1 2018 2222 July 2nd 2018 . 0 0
1 2019 2222 January 7th 2019 . 1 1
2 2016 4444 May 4th 2016 July 1st 2016 1 .
2 2016 5555 August 4th 2016 . 0 0
2 2017 9999 May 1st 2017 . 1 1
3 2011 9999 October 22nd 2011 . 1 .
3 2017 9999 . November 20th 2017 1 .
3 2017 3333 November 28th 2017 . 0 0
Thank you very much in advance for any helpful suggestion
- YEAR is a long variable referring to the observation year
- EMPLOYEE_ID is a float variable to anonymously identify a person who’s been hired
- COMPANY_ID is also an anonymizing float variable identifying a company
- HIRING_DATE is also a float, and it is displayed with time format
- DISMISSAL_DATE is float and displayed with time format
- OPEN is a dummy variable with value 1 if the hiring is based on an open-ended contract, and 0 in case of a fixed-term contract.
- 1, in case an employee was either dismissed or NOT in possession of an open-ended contract in the SIX (6) months prior to hiring
- 0, if the worker had any open-ended contract during at least one day of the 6 months preceding the recruitment
- Missing, in case it is not possible to verify so, for instance in case the observation in question is the earliest hiring reported for that employee, or in case the observation relates to a dismissal only.
As an example of what I am trying to do:
EMPLOYEE_ID YEAR COMPANY_ID HIRING_DATE DISMISSAL_DATE OPEN ELIGIBLE
1 2016 1111 January 1st 2016 . 1 .
1 2018 1111 . June 1st 2018 1 .
1 2018 2222 July 2nd 2018 . 0 0
1 2019 2222 January 7th 2019 . 1 1
2 2016 4444 May 4th 2016 July 1st 2016 1 .
2 2016 5555 August 4th 2016 . 0 0
2 2017 9999 May 1st 2017 . 1 1
3 2011 9999 October 22nd 2011 . 1 .
3 2017 9999 . November 20th 2017 1 .
3 2017 3333 November 28th 2017 . 0 0
Thank you very much in advance for any helpful suggestion
Comment