Hello everyone
I'm trying to compare the duration of episodes (actually, duration of job contracts) in one period of time (2005-2010) to another (2010-2015). The reason is that in 2010 and in 2012 there were two policies implemented that might have affected the duration of the contracts, so I want to check if it was the case.
I have two variables that let me know when each contract starts and finishes. This is an example of the date variable for when the contract started:
As you can see, it is in the format of yyyymmdd. The variable for the date the contract finishes is in the same format. I would like to be able to generate another variable with the duration of contracts in days for the period 2005-2010 and for the 2010-2015 period, but I can't seem to come up with a good answer. Do you guys know of any way this could be done?
One idea I was thinking about is to first filter contracts if they were active during the 05-10 period. Then substract the date the contract ended from the date the contract started, but the problem is that many contracts started before 05 or continue beyond 2010, and I want to only get the duration of contracts for *within* that time window, not get days of duration that took place before 05. And same situation with the 10-15 time window, I want to get the duration of episodes only within it. So I would need to find a way to make all contract start dates prior to 05 (and to 10 for the second calculation) equal to 1-1-05, and contract end dates beyond 2009 equal to 31-12-09; I think that would mean creating extra variables of course, since I want to keep the original dates, as I need to repeat the process for the 2010-2015 time period.
I don't know how to proceed or how to make the calculations in days.
Thank yo so much for your help.
I'm trying to compare the duration of episodes (actually, duration of job contracts) in one period of time (2005-2010) to another (2010-2015). The reason is that in 2010 and in 2012 there were two policies implemented that might have affected the duration of the contracts, so I want to check if it was the case.
I have two variables that let me know when each contract starts and finishes. This is an example of the date variable for when the contract started:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long F_ALTA 19820301 19881103 20120213 20120501 19760501 19790808 19761102 19990901 19950101 19971001 19860414 19900110 19920528 19970301 19880314 19891001 19891112 19870501 19801020 19810421 20140501 20140902 20050601 19941004 20091101 20140902 19811210 19821201 19810331 19900502 19901001 19931213 19930911 20130813 20140801 19910408 19990419 20020515 19880707 19960801 20111202 19920525 19910712 19990705 20020902 19920504 19960223 19961023 19970519 20040714 20040913 20060904 20071203 20030201 20030908 20091118 20100104 20110117 20120220 20120625 19920111 19961001 20020406 20030712 20040404 20040601 20081205 20100206 20101223 20110924 20111214 20120126 20120201 20120405 19901018 19901022 19880926 19891128 19960101 19860701 19720327 19760901 19800501 19861001 19891010 19910501 19730201 19851104 19860415 19870107 19880913 19900801 19791015 19801203 19840201 19910501 19960101 19871123 19810114 19740129 end
As you can see, it is in the format of yyyymmdd. The variable for the date the contract finishes is in the same format. I would like to be able to generate another variable with the duration of contracts in days for the period 2005-2010 and for the 2010-2015 period, but I can't seem to come up with a good answer. Do you guys know of any way this could be done?
One idea I was thinking about is to first filter contracts if they were active during the 05-10 period. Then substract the date the contract ended from the date the contract started, but the problem is that many contracts started before 05 or continue beyond 2010, and I want to only get the duration of contracts for *within* that time window, not get days of duration that took place before 05. And same situation with the 10-15 time window, I want to get the duration of episodes only within it. So I would need to find a way to make all contract start dates prior to 05 (and to 10 for the second calculation) equal to 1-1-05, and contract end dates beyond 2009 equal to 31-12-09; I think that would mean creating extra variables of course, since I want to keep the original dates, as I need to repeat the process for the 2010-2015 time period.
I don't know how to proceed or how to make the calculations in days.
Thank yo so much for your help.
Comment