10 



Fishery Bulletin 100(1) 



Appendix 



The following SAS (version 6.12) code was used to estimate 

 parameters in the three-reader model discussed above. This 

 program makes use of iteratively reweighted least squares 

 to maximize the likelihood function. Observed values (e.g. 

 the number of HHH) are equated with the corresponding 

 expected value from the model and a weighted least squares 

 fit is computed by using PROC NLIN. This computation is 

 iterated to convergence of the parameter estimates. Weights 

 are inverses of the predicted values at each iteration. Indi- 

 cator variables for each possible outcome are generated so 



that a model in typical regi'ession form can be written. 

 Bounds on the parameter estimates may be needed to con- 

 strain the estimates to the appropriate intervals. Note that 

 the asymptotic standard errors provided by SAS will be 

 correct if the option SIGSQ=1 is specified. However, the 

 printed degrees of freedom and the associated confidence 

 intei-vals are not correct for this application. The residual 

 weighted sum of squares listed by SAS is the chi-squared 

 goodness-of-fit-statistic. The option, OUTEST, outputs point 

 estimates and the the estimated covariance matrix for the 

 parameters. SAS code for the multistrata model used in the 

 second example is also available from the authors. 



/* SAS Code for estimating 3-reader, 1 -stratum model 7 



data a; 

 array x{8} x1-x8; 

 input y, 



ntot-i-y. /■ accumulating sample size V 



if n =8 ttien call symput('ntot'.ntot); /" put total into macro var 7 

 do 1=1 to 8: 



if l=_n _ ttien x{i}=1 ; else x{i)=0, /" set up indicator variables 7 



end; 

 cards, 

 406 

 13 

 1 



1 

 6 

 2 

 6 

 135 



/' H H H 7 

 /• H H W 7 

 /• H W H 7 

 /•WH H 7 

 /* H W W 7 

 /• W H W 7 

 /• W W H 7 

 /• W W W 7 



proc nlin data=a nohalve sigsq=1 outest=esti /' sigsq=1 for correct se's 7 



parms a1= 9 a2= 9 a3= 9 b1 = .9 b2= 9 b3= 9 p=,6; /" starting values 7 



/* a IS accuracy for H 7 

 /■ b is accuracy for W 7 



el =a1 •a2-a3-p-i-(1 -b1 )71 ■b2)-(1 ■b3)'(1 -p) 

 e2=ara2*(1-a3)'p-i-(1-b1)*(1-b2)*b3*(1-p) 

 e3=a1 •(! -a2)*a3*p+(1 -b1 )*b271 -b3)*(1 -p) 

 e4=(1-a1)*a2'a3-p-i-br(1-b2)*(1-b3)*(1-p) 

 e5=a1 -(1 -a2)-(1 -aSj-p-fll-bl )-b2'b3'(1 -p) 

 e6=( 1 -al )'a2'(1 -a3)'p-fb1 '(1 -b2)*b3'(1 -p) 

 e7=(1-a1)*(1-a2)*a3*p-i-brb2"(1-b3)*{1-p) 

 e8=(1-a1)*(1-a2)'(1-a3)*p-i-b1'b2'b3*(1-p) 

 model y=(e1■x1^-e2■x2-l-e3■x3-^e4■x4+e5*x5+e6■x6-^e7■x7-^e8■x8)■&ntot: 

 bounds 5<=a1<=1, 0.5<=a2<=1, 0-5<=a3<=1, 0,5<=b1<=1, 0-5<=b2<=1 

 5<=b3<=1, 0<=p<=1: 

 weigtit_=1/model y; 

 run; 



