* duration to epi PhD, cohorts < 2000, data as of Fall 2002 ; * data sorted by duration, with exits before censored; * this order is helpful if wish to calculate lifetable / k-m curve by hand; * observations can be in any order if using survival analysis software; /* ----- for SAS ---- [ Stata at end ] */ data a; INPUT yr_entry i duration phd counter ; * phd: 1 obtained, 0 not yet; LINES; 1977 1 2 1 119 1979 2 3 1 118 1980 3 3 1 117 1986 4 3 1 116 1987 5 3 1 115 1989 6 3 1 114 1995 7 3 1 113 1995 8 3 1 112 1995 9 3 1 111 1999 10 3 0 110 1999 11 3 0 109 1999 12 3 0 108 1999 13 3 0 107 1999 14 3 0 106 1999 15 3 0 105 1999 16 3 0 104 1969 17 4 1 103 1972 18 4 1 102 1972 19 4 1 101 1975 20 4 1 100 1977 21 4 1 99 1980 22 4 1 98 1983 23 4 1 97 1987 24 4 1 96 1989 25 4 1 95 1990 26 4 1 94 1991 27 4 1 93 1991 28 4 1 92 1991 29 4 1 91 1991 30 4 1 90 1992 31 4 1 89 1994 32 4 1 88 1994 33 4 1 87 1994 34 4 1 86 1997 35 4 1 85 1998 36 4 1 84 1998 37 4 0 83 1998 38 4 0 82 1998 39 4 0 81 1998 40 4 0 80 1998 41 4 0 79 1998 42 4 0 78 1998 43 4 0 77 1970 44 5 1 76 1980 45 5 1 75 1987 46 5 1 74 1987 47 5 1 73 1988 48 5 1 72 1989 49 5 1 71 1993 50 5 1 70 1993 51 5 1 69 1993 52 5 1 68 1994 53 5 1 67 1994 54 5 1 66 1996 55 5 1 65 1996 56 5 1 64 1996 57 5 1 63 1997 58 5 0 62 1997 59 5 0 61 1997 60 5 0 60 1997 61 5 0 59 1997 62 5 0 58 1997 63 5 0 57 1997 64 5 0 56 1973 65 6 1 55 1977 66 6 1 54 1979 67 6 1 53 1979 68 6 1 52 1979 69 6 1 51 1981 70 6 1 50 1983 71 6 1 49 1984 72 6 1 48 1985 73 6 1 47 1988 74 6 1 46 1989 75 6 1 45 1989 76 6 1 44 1990 77 6 1 43 1990 78 6 1 42 1991 79 6 1 41 1991 80 6 1 40 1992 81 6 1 39 1992 82 6 1 38 1993 83 6 1 37 1993 84 6 1 36 1993 85 6 1 35 1994 86 6 1 34 1996 87 6 0 33 1996 88 6 0 32 1970 89 7 1 31 1978 90 7 1 30 1982 91 7 1 29 1983 92 7 1 28 1988 93 7 1 27 1988 94 7 1 26 1989 95 7 1 25 1990 96 7 1 24 1992 97 7 1 23 1995 98 7 1 22 1995 99 7 1 21 1995 100 7 0 20 1975 101 8 1 19 1978 102 8 1 18 1979 103 8 1 17 1981 104 8 1 16 1983 105 8 1 15 1984 106 8 1 14 1977 107 9 1 13 1980 108 9 1 12 1983 109 9 1 11 1985 110 9 1 10 1987 111 9 1 9 1988 112 9 1 8 1988 113 9 1 7 1988 114 9 1 6 1991 115 9 1 5 1992 116 9 1 4 1981 117 11 1 3 1988 118 12 1 2 1974 119 13 1 1 ; RUN; title1 still pursuing; title2 lifetable ; proc lifetest data=a method = lt width=1 graphics plots = (s, ls, h, p); time duration*phd(0); run; title1 still pursuing; title2 verbose version of k-m ; proc lifetest data=a method = km graphics plots = (s, ls, h, p) /* see plots options */ time duration*phd(0); run; title1 still pursuing; title2 concise version of k-m , user specifies times with timelist ; proc lifetest data=a method = km graphics plots = (s, ls, h, p) timelist = 1 2 3 4 5 6 7 8 9 10 11 12 ; time duration*phd(0); run; /* ----- for Stata */ * duration to epi PhD, cohorts < 2000, data as of Fall 2002 * data sorted by duration, with exits before censored * this order is helpful if wish to calculate lifetable / k-m curve by hand * observations can be in any order if using survival analysis software /* phd: 1 obtained, 0 not yet */ input yr_entry i duration phd counter 1977 1 2 1 119 1979 2 3 1 118 1980 3 3 1 117 1986 4 3 1 116 1987 5 3 1 115 1989 6 3 1 114 1995 7 3 1 113 1995 8 3 1 112 1995 9 3 1 111 1999 10 3 0 110 1999 11 3 0 109 1999 12 3 0 108 1999 13 3 0 107 1999 14 3 0 106 1999 15 3 0 105 1999 16 3 0 104 1969 17 4 1 103 1972 18 4 1 102 1972 19 4 1 101 1975 20 4 1 100 1977 21 4 1 99 1980 22 4 1 98 1983 23 4 1 97 1987 24 4 1 96 1989 25 4 1 95 1990 26 4 1 94 1991 27 4 1 93 1991 28 4 1 92 1991 29 4 1 91 1991 30 4 1 90 1992 31 4 1 89 1994 32 4 1 88 1994 33 4 1 87 1994 34 4 1 86 1997 35 4 1 85 1998 36 4 1 84 1998 37 4 0 83 1998 38 4 0 82 1998 39 4 0 81 1998 40 4 0 80 1998 41 4 0 79 1998 42 4 0 78 1998 43 4 0 77 1970 44 5 1 76 1980 45 5 1 75 1987 46 5 1 74 1987 47 5 1 73 1988 48 5 1 72 1989 49 5 1 71 1993 50 5 1 70 1993 51 5 1 69 1993 52 5 1 68 1994 53 5 1 67 1994 54 5 1 66 1996 55 5 1 65 1996 56 5 1 64 1996 57 5 1 63 1997 58 5 0 62 1997 59 5 0 61 1997 60 5 0 60 1997 61 5 0 59 1997 62 5 0 58 1997 63 5 0 57 1997 64 5 0 56 1973 65 6 1 55 1977 66 6 1 54 1979 67 6 1 53 1979 68 6 1 52 1979 69 6 1 51 1981 70 6 1 50 1983 71 6 1 49 1984 72 6 1 48 1985 73 6 1 47 1988 74 6 1 46 1989 75 6 1 45 1989 76 6 1 44 1990 77 6 1 43 1990 78 6 1 42 1991 79 6 1 41 1991 80 6 1 40 1992 81 6 1 39 1992 82 6 1 38 1993 83 6 1 37 1993 84 6 1 36 1993 85 6 1 35 1994 86 6 1 34 1996 87 6 0 33 1996 88 6 0 32 1970 89 7 1 31 1978 90 7 1 30 1982 91 7 1 29 1983 92 7 1 28 1988 93 7 1 27 1988 94 7 1 26 1989 95 7 1 25 1990 96 7 1 24 1992 97 7 1 23 1995 98 7 1 22 1995 99 7 1 21 1995 100 7 0 20 1975 101 8 1 19 1978 102 8 1 18 1979 103 8 1 17 1981 104 8 1 16 1983 105 8 1 15 1984 106 8 1 14 1977 107 9 1 13 1980 108 9 1 12 1983 109 9 1 11 1985 110 9 1 10 1987 111 9 1 9 1988 112 9 1 8 1988 113 9 1 7 1988 114 9 1 6 1991 115 9 1 5 1992 116 9 1 4 1981 117 11 1 3 1988 118 12 1 2 1974 119 13 1 1 end stset duration, failure(phd) sts graph, l1title("proportion") title("years since entry") sts list stsum