proc contents data=sasuser.fa_bd; run; %let t0 = 93.0 ; %let t1 = 97.00; %let t2 = 98.75; options ps=45 ls=90; proc plot data = sasuser.fa_bd; plot sb_rate*birth_tq=latecare; where (latecare eq 0 and birth_tq > &t0); run; data a; set sasuser.fa_bd; clock1 = min(max(0, birth_tq - &t0),(&t1 - &t0) - 0.25); clock2 = min(max(0, birth_tq - &t1),(&t2 - &t1) - 0.25); clock3 = max(0, birth_tq - &t2); after = . ; if birth_tq > &t0 and birth_tq < &t1 then after = 0; if birth_tq > &t2 then after = 1; run; proc reg data = a; model sb_rate = after ; where (latecare eq 0 and after ne . ); run; proc genmod data = a; model sb_no/n_births = after / dist=binomial link=identity obstats; where (latecare eq 0 and after ne . ); run; proc genmod data = a; model sb_no/n_births = after / dist=binomial link=logit obstats; where (latecare eq 0 and after ne . ); run; options ps=40 ls=90; proc plot data = a; plot clock1*birth_tq="1" clock2*birth_tq="2" clock3*birth_tq="3" / overlay; where (latecare eq 0 and birth_tq > &t0); run; options ps=50 ls=90; proc reg data = a; model sb_rate = clock1 clock2 clock3; where (latecare eq 0 and birth_tq > &t0); output out = b predicted = fitted; run; proc plot data=b; plot sb_rate*birth_tq = "*" fitted*birth_tq="F" / overlay; where (latecare eq 0 and birth_tq > &t0); run; run; proc gplot data=b; plot sb_rate*birth_tq fitted*birth_tq / overlay; where (latecare eq 0 and birth_tq > &t0); run; run; proc genmod data = a; model sb_no/n_births = clock1 clock2 clock3 / dist=binomial link=identity obstats; where (latecare eq 0 and birth_tq > &t0);; run; proc reg data = a; model sb_rate = after; where (latecare eq 0 and after ne . ); output out=b predicted = fitted; run; proc genmod data = a; model sb_no/n_births = after / dist=binomial link=identity obstats; where (latecare eq 0 and after ne . ); run; proc genmod data = a; model sb_no/n_births = after / dist=binomial link=logit obstats; where (latecare eq 0 and after ne . ); run;