Year of birth and month of birth of each individual in a given dataset, now I want to generate two variables as follows:
1) Year of birth in month; and
2) Year of birth in month among those who were born after August 1980 (1=yes, 0=no)
Any help is much appreciated. Thanks!
Data
Code:
clear input double id byte month int year 100202 12 1986 100302 3 1978 100402 12 1983 100405 10 1991 100503 2 1989 100504 4 1993 100505 3 1995 100602 8 1965 100702 1 1975 100703 11 1996 100902 11 1971 101104 2 1983 101203 5 1990 101304 10 1984 101305 2 1985 101404 8 1987 101502 1 1982 101506 8 1987 101507 6 1991 101602 9 1969 101704 8 1985 101804 5 1983 101905 6 1990 101907 9 1994 102002 12 1977 200105 7 1996 200402 9 1974 200403 10 1995 200501 8 1976 200603 12 1982 200704 11 1993 200705 6 1994 201102 10 1972 201104 6 1993 201203 2 1987 201301 11 1974 201303 6 1994 201401 1 1975 201502 10 1978 201506 5 1984 201604 9 1982 201605 12 1993 300104 3 1983 300106 1 1983 300204 2 1974 300205 5 1998 300304 10 1984 300502 12 1973 300503 9 1995 300604 10 1980 300704 5 1985 300709 2 1984 300803 5 1981 300902 10 1974 301003 11 1971 301004 11 1998 301103 3 1987 301204 9 1978 301302 11 1971 301303 3 1997 301404 8 1985 301604 6 1972 301606 10 1993 301704 3 1983 301801 3 1986 301902 12 1968 301903 3 1997 302001 3 1980 400104 12 1995 400204 3 1995 400302 8 1964 400503 3 1986 400602 2 1970 400902 5 1969 400903 8 1993 401002 9 1985 401303 1 1993 401501 3 1978 401602 7 1968 401704 7 1982 401902 12 1984 402003 7 1985 402006 12 1991 500102 6 1991 500202 9 1971 500203 10 1996 500302 2 1971 500402 3 1976 500501 1 1988 500702 1 1969 500703 12 1990 500802 4 1967 500803 5 1990 500804 3 1996 500904 11 1971 501002 3 1984 501003 11 1988 501104 7 1981 501302 5 1974 501403 5 1989 end label values month wb1m label values year wb1y
0 Response to How to calculate year in month with conditions
Post a Comment