$units 242 $data afe yfe exp tfe case pyr expt $ $format (4(x,f2.0),11x,f3.0,8x,2(x,f12.6)) $c Read in data from Appendix VII (nickel4.dat) $din 10 60 $ $c Declare offset to be logarithm of expected number of cases $cal expt = expt/1000 : lex = %log(expt) $off lex $ $yvar case $err p $ $fac 242 afe 4 yfe 4 exp 5 tfe 5 $ $c Fit multiplicative model $fit afe+yfe+exp+tfe $ $dis m e $ $c Extract parameter estimates and convert into relative risks $ext %pe $cal rr = %exp(%pe) $look rr $ $c Now continue with EMR model $off $ $mac M1 $cal %fv = %exp(%lp)*pyr + expt $$endmac $mac M2 $cal %dr = 1./(%fv - expt) $$endmac $mac M3 $cal %va = %fv $$endmac $mac M4 $cal %yv = %if(%lt(%yv,.5),.0000001,%yv) $ $cal %di = 2*(%yv*%log(%yv/%fv) - (%yv-%fv)) $$endmac $own M1 M2 M3 M4 $fit . $rec 10 $fit . $ $dis m e $ext %pe $cal rr = %exp(%pe) $look rr $ $return