Dear all,
I want to create a is a dummy variable which is equal to 1 if the child was born in December and 0 if she/he was born in January of the following year. The data example below includes both year and month of birth of both mothers and their children. Any help would be highly appreciated.
I want to create a is a dummy variable which is equal to 1 if the child was born in December and 0 if she/he was born in January of the following year. The data example below includes both year and month of birth of both mothers and their children. Any help would be highly appreciated.
Code:
clear input byte mom_mob int mom_yob byte child_mob int child_yob 6 1982 1 2014 5 1988 12 2017 6 1989 12 2011 5 1976 12 2003 9 1976 12 2003 11 1986 1 2015 3 1976 12 2012 3 1976 1 1998 12 1972 12 1995 2 1975 12 2002 9 1970 12 1991 4 1975 12 2000 6 1969 1 1995 11 1991 12 2014 11 1985 12 2013 5 1969 12 2008 1 1993 12 2015 3 1988 1 2013 5 1983 12 2017 5 1983 1 2006 5 1983 12 2003 8 1981 12 2006 9 1976 1 1995 7 1985 12 2013 1 1970 1 2007 4 1977 12 2000 4 1968 12 2001 4 1968 12 1994 3 1980 1 2004 7 1985 12 2010 10 1968 1 1991 2 1979 1 2008 2 1979 1 2004 11 1975 12 2006 11 1975 12 2002 3 1975 12 2005 9 1977 12 2006 9 1988 1 2015 2 1986 1 2013 4 1977 12 2007 4 1977 1 2000 11 1987 12 2009 7 1979 1 1999 6 1989 12 2013 6 1969 12 1989 4 1978 1 2011 7 1981 1 2003 10 1981 1 2010 1 1990 1 2016 11 1972 1 1998 4 1987 1 2008 6 1971 1 1992 11 1972 12 2001 4 1971 12 1996 1 1983 12 2007 6 1980 1 2002 8 1983 12 2009 2 1984 1 2007 9 1984 1 2013 12 1972 12 1997 12 1972 12 1992 6 1986 1 2013 9 1997 12 2015 5 1985 1 2010 6 1976 1 2006 7 1972 12 2007 7 1972 12 2007 7 1972 12 2002 7 1972 1 2000 7 1983 1 2011 3 1980 12 2012 9 1974 1 2001 12 1984 1 2013 8 1996 12 2014 3 1971 12 1996 9 1990 12 2012 9 1990 1 2008 6 1987 1 2010 10 1971 1 1999 10 1971 1 1997 6 1971 12 1993 11 1974 12 1995 1 1982 12 2007 2 1973 1 1996 2 1969 12 1993 6 1979 12 1998 4 1968 12 1997 4 1968 12 1991 3 1993 12 2016 10 1986 12 2014 9 1985 1 2007 4 1981 1 2011 5 1983 1 2008 5 1983 12 2004 7 1977 12 2001 4 1973 12 2000 6 1995 12 2014 2 1977 12 1998 3 1972 1 2005 2 1984 12 2016 end lab var mom_mob "mom's month of birth" lab var mom_yob "mom's year of birth" lab var child_mob "child's month of birth" lab var child_yob "child's year of birth"
Comment