########## Oscars data , 20 selected male perfromers (who won or were nominated) Data from SAS (Sas code for splitting records given at bottom of this file) BIRTH AGE_NOM1 AGE_WIN1 AGE_LAST DEAD 1971 8 . 30 0 1962 31 . 39 0 1961 34 . 40 0 1930 36 . 50 1 1888 52 . 53 1 1899 44 52 58 1 1942 34 . 59 0 1901 35 40 60 1 1929 38 . 60 1 1941 56 . 60 0 1939 23 . 62 0 1936 61 . 65 0 1935 53 . 66 0 1933 56 . 68 0 1916 44 . 72 1 1923 39 . 73 1 1925 33 61 76 0 1919 46 46 77 1 1888 42 . 84 1 1911 33 . 90 0 # ph analysis in R, using "t.from, t.to" format for staggered entry require(survival) # this next analysis is INCORRECT.. it treats winner as a fixed variate, # as though it were determined from the outset, when in fact it is dynamic.. # all start out as non-winners.. age.from = c( 8,31,34,36,52,44,34,35,38,56,23,61,53,56,44,39,33,46,42,33); age.to = c(30,39,40,50,53,58,59,60,60,60,62,65,66,68,72,73,76,77,84,90); dead = c( 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0); winner = c( 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0); year.birth=c(1971,1962,1961,1930,1888,1899,1942,1901,1929,1941, 1939,1936,1935,1933,1916,1923,1925,1919,1888,1911); summary( coxph(Surv(age.from,age.to,dead) ~ winner) ) # BUT, by 'splitting' the records for the 4 who won, it be made into a form # that allows "winner" to be treated as a dynamic variate. age.from = c( 8,31,34,36,52, 44,52, 34, etc); age.to = c(30,39,40,50,53, 52,58, 59, etc); dead = c( 0, 0, 0, 1, 1, 0, 1, 0, etc); winner = c( 0, 0, 0, 0, 0, 0, 1, 0, etc); # NOW in coxph(Surv(age.from,age.to,dead) ~ winner) # "winner" be have the correct value in each riskset ======== SAS split records, using the BIRTH AGE_NOM1 AGE_WIN1 AGE_LAST DEAD ======== (above) as the source file ( "for634" ) data split; keep identity t_from t_to d w ; set for634; if age_win1 = . then do; t_from=age_nom1; t_to = age_last; d = dead; w = 0; output; end; if age_win1 ne . then do; if age_nom1 < age_win1 then do; t_from=age_nom1; t_to = age_win1; d = 0 ; w=0;output; end; t_from=age_win1; t_to = age_last; d = dead; w=1;output; end; proc print; proc phreg data=split; model (t_from,t_to)*d(0) = w / ties=efron; Run;