model{ #total<-sum(freqobs[1:8]) #Likelihood freqobs[1:8]~dmulti(p[1:8],total) for (i in 1:8){ p[i]<-prev*(positive[i])+(1-prev)*(negative[i]) positive[i]<-(s[1]*test1[i]+(1-s[1])*(1-test1[i])) #sensitivity(test1) * (s[2]*test2[i]+(1-s[2])*(1-test2[i])) #sensitivity(test2) * (s[3]*test3[i]+(1-s[3])*(1-test3[i])) #sensitivity(test3) negative[i]<- ((1-x[1])*test1[i]+x[1]*(1-test1[i])) #specificity(test1) * ((1-x[2])*test2[i]+x[2]*(1-test2[i])) #specificity(test2) * ((1-x[3])*test3[i]+x[3]*(1-test3[i])) #specificity(test3) } #Prior #Test 3 specificity fixed at 97.2% (California sea lion example) #noninformative priors used for other parameters in this example #For simulations using arc points A-H, this is the value you would #fix to the specificity of the arc point selected prev~dbeta(1,1) s[3]~dbeta(1,1) x[3]<- 0.972 for (j in 1:2){ s[j]~dbeta(1,1) x[j]~dbeta(1,1) } #s[6]<-s[1]+s[2]-s[1]*s[2] #Prediction freqpred[1:8]~dmulti(p[1:8],total) #Bayesian_p for (i in 1:8){ pvalue[i]<-step(freqpred[i]-freqobs[i]) } }