Dear all,
I am interested in a policy A and its eligibility is: children under the age of 5 at the time of the policy implementation in the county they live is eligible.
I need help in generating a variable, which is is the fraction of years that a child from a cohort born in a county are exposed to the policy from conception (i.e., one year before birth) to age 5. So, the faction variable is a function only of the child’s county and year of birth. For example, cohorts who are born one year right after the introduction of the policy in the county they live are considered fully exposed (e.g., =1), while those aged 6 and above in the reform year of each county are defined as non-exposed (e.g., =0).
Since exposure to the policy depends on the timing of the policy implementation in each country and the year of birth of each child, I would expect that cohorts born from 1991-1996 are not exposed because they are six years old and older relative to the starting point of the policy in 2002. Additionally, some cohorts born in 1998 could be partially exposed (if the timing of the policy implementation in the county they lived was in 2002 - they were 4 years old at that time) or non-exposed (if the timing of the policy implementation in the county they lived was in 2004 - they were 6 years old at that time). Any help is much appreciated. Thanks!
The data example below where countyID is the county where children reside, yob is the child's year of birth, and enrolled_yr is the timing of the policy implementation in each country.
I am interested in a policy A and its eligibility is: children under the age of 5 at the time of the policy implementation in the county they live is eligible.
I need help in generating a variable, which is is the fraction of years that a child from a cohort born in a county are exposed to the policy from conception (i.e., one year before birth) to age 5. So, the faction variable is a function only of the child’s county and year of birth. For example, cohorts who are born one year right after the introduction of the policy in the county they live are considered fully exposed (e.g., =1), while those aged 6 and above in the reform year of each county are defined as non-exposed (e.g., =0).
Since exposure to the policy depends on the timing of the policy implementation in each country and the year of birth of each child, I would expect that cohorts born from 1991-1996 are not exposed because they are six years old and older relative to the starting point of the policy in 2002. Additionally, some cohorts born in 1998 could be partially exposed (if the timing of the policy implementation in the county they lived was in 2002 - they were 4 years old at that time) or non-exposed (if the timing of the policy implementation in the county they lived was in 2004 - they were 6 years old at that time). Any help is much appreciated. Thanks!
The data example below where countyID is the county where children reside, yob is the child's year of birth, and enrolled_yr is the timing of the policy implementation in each country.
Code:
clear input float(countyID yob enrolled_yr) 161 2004 2002 161 2004 2002 161 2006 2002 161 1991 2002 161 2001 2002 161 2001 2002 161 2001 2002 161 2006 2002 161 2002 2002 161 2002 2002 161 2002 2002 161 1994 2002 161 2006 2002 167 1997 2002 167 1997 2003 167 1997 2003 167 1997 2003 167 2004 2003 162 2004 2003 162 1999 2003 162 1999 2003 162 1999 2003 162 1999 2003 162 2003 2003 162 1993 2003 162 1993 2003 162 1995 2004 162 1995 2004 162 1995 2004 162 1995 2004 163 1995 2004 163 1991 2004 163 1993 2004 163 1993 2004 163 1998 2004 163 1998 2004 163 1998 2004 163 1998 2004 163 2004 2004 163 2004 2004 163 1995 2004 163 1995 2004 163 1995 2004 163 1992 2006 163 1992 2006 164 1992 2006 164 1992 2006 164 2001 2006 164 2001 2006 164 2001 2006 164 2004 2006 164 2004 2006 164 1991 2006 164 2003 2006 164 2003 2006 164 1991 2006 164 1992 2006 164 1992 2005 164 1991 2005 165 1994 2005 165 1994 2005 165 1993 2005 165 1998 2005 165 1998 2005 165 1998 2005 165 1998 2005 165 2001 2005 165 2001 2005 165 2002 2005 165 2002 2005 165 2002 2005 166 1997 2005 166 1997 2005 166 1997 2005 166 1997 2005 166 1997 2005 166 1997 2005 166 1997 2005 166 1997 2005 166 2002 2005 166 2002 2005 166 1991 2005 166 1996 2005 166 1996 2005 166 2000 2005 167 1993 2005 167 1993 2005 167 2000 2005 167 2000 2005 101 2003 2003 101 2003 2003 101 1992 2003 101 1991 2003 101 1991 2003 101 1992 2003 101 2005 2003 101 2002 2003 101 2002 2003 101 1993 2003 101 1993 2003 101 2006 2003 101 2006 2003 101 1995 2003 102 1995 2003 102 2006 2003 102 2001 2004 102 2001 2004 102 2001 2004 102 2003 2004 102 2003 2004 102 2007 2004 102 2000 2004 102 2000 2004 102 2000 2004 102 2000 2004 102 2007 2004 102 2007 2004 102 2007 2004 102 1996 2004 104 1996 2004 104 1996 2004 104 2000 2004 104 2000 2004 104 2001 2004 104 2001 2006 104 2001 2006 104 1999 2006 104 1999 2006 104 1999 2006 104 1999 2006 104 1999 2006 104 1999 2006 104 1999 2006 104 2005 2006 104 2004 2006 104 2004 2006 104 2001 2006 104 2001 2006 104 2002 2006 104 2002 2006 104 1997 2006 104 1997 2007 105 1997 2007 105 2005 2007 105 2004 2007 105 2004 2007 105 1998 2007 105 1998 2007 105 1998 2007 105 1998 2007 105 2000 2007 105 2000 2007 105 2000 2007 105 2000 2007 105 2001 2007 105 2001 2007 105 2001 2007 105 2005 2007 105 1992 2007 105 2006 2007 103 1993 2007 103 1993 2007 103 2007 2007 103 2007 2007 103 2007 2007 103 1999 2007 103 2003 2007 103 2003 2007 103 2005 2007 103 2005 2007 106 2005 2007 106 1995 2007 106 1995 2007 106 1994 2007 106 1994 2007 106 2004 2007 106 2004 2007 106 2002 2007 106 2002 2007 106 2002 2007 106 1994 2007 106 1996 2007 107 1996 2007 107 2002 2007 107 2002 2007 107 1999 2007 107 1999 2007 167 1999 2005 107 1999 2007 107 1993 2002 107 1993 2002 107 1996 2002 107 1994 2002 107 2004 2002 107 2000 2002 107 2000 2002 107 2000 2002 107 2000 2002 107 2003 2002 107 2003 2002 end
Comment