Wednesday, September 1, 2010

Chapter 5 Code for Advanced Bayesian Methods for Medical Test Accuracy



BUGS CODE 5.1


# x1 is age

#x2 is location

# x3 is test a or  b

# r is the false positive  occurrence

model
            {
for( i in 1 : N ) {
r[i] ~ dbern(p[i])
p[i] <- exp( beta[1]+beta[2]*x1[i]+beta[3]*x2[i]+beta[4]*x3[i]+beta[5]*x2[i]*x3[i])}
              
phat <- mean(p[])
 for (i in 1:5 ){
           
           
 beta[i] ~ dnorm(0.0,0.001)}
           
A<-exp(beta[3])
B<-exp(beta[4])
C<-exp(beta[5])         
           
            }

Data

                list( r = c(1,0,0,0,1,1,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,1,0,1,0,0,1,0,0,1,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,0,0,1,0,0,0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,1,0,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
                               
                                x1 = c(35,33,33,38,40,40,38,38,31,44,44,37,38,38,35,31,40,32,32,32,31,34,36,32,41,46,30,33,33,40,43,32,32,38,38,35,37,34,34,32,40,38,38,35,30,24,38,38,29,34,27,30,35,35,35,30,40,40,37,35,39,39,32,32,32,39,35,34,33,33,37,34,25,37,32,31,39,39,33,37,37,34,43,39,39,34,41,46,38,35,32,36,36,44,42,33,37,35,41,41,41,41,30,36,40,33,40,40,39,39,35,41,33,33,33,33,38,36,36,29,30,34,37,38,38,34,32,32,40,40,44,44,39,43,43,36,26,41,41,34,34,20,30,34,34,36,34,34,33,33,26,26,33,37,37,33,33,34,35,35,43,43,44,31,38,36,34,37,37,37,37,36,29,29,32,41,38,33,33,36,37,37,35,31,26,25,35,35,25,37,48,33,37,41,27,38,38,39,40,40,32,36,36,39,39,35,35,39,33,37,45,45,33,33,39,30,30,31,31,35,35,30,32,32,40,40,36,33,42,42,27,46,46,35,31,35,31,32,32,39,34,39,38,36,32,30,30,34,34,37,37,38,29,35,30,30,30,34,37,37,36,37,38,40,40,29,44,44,27,31,31,40,36,36,34,34,42,34,34,38,37,40,37,34,37,23,24,38,38,39,28,32,40,38,33,33,36,34,39,34,45,43,43,31,34,34,38,37,37,36,33,35,28,44,44,28,28,42,34,34,34,34,44,40,33,30,37,44,44,34,34,47,26,38,38,29,29,43,43,40,42,36,40,40,35,37,30,27,41,41,29,29,29,35,39,39,31,42,28,36,36,38,37,31,31,34,29,27,39,30,40,40,34,36,32,40,30,43,40,36,36,40,40,36,44,34,34,32,40,40,31,31,31,34,34,32,46,38,32,32,41,41,40,36,36,30,30,32,38,37,37,41,34,34,32,34,34,47,38,31,38,34,34,36,34,34,40,37,30,39,36,36,40,40,37,37,32,38,30,28,30,30,47,40,34,34,32,38,30,39,29,54,54,28,36,35,35,37,35,35,43,31,37,35,26,29,42,35,34,45,38,38,32,37,41,41,33,36,47,37,38,27,30,
                                26,26,38,29,38,45,30,38,33,32,40,39,40,42,34,34,42,40,32,32,33,33,40,46,40,39,38,38,33,33,37,37,34,30,32,32,31,38,38,35,44,44,45,45,31,31,31,32,32,49,38,39,39,39,23,31,31,30,27,40,40,45,35,33,38,38,32,31,35,35,32,27,32,21,21,34,34,42,34,38,46,37,39,39,37,36,31,38,38,43,43,31,32,37,32,32,41,41,35,35,31,27,36,34,28,30,30,37,34,47,47,27,32,36,36,36,36,40,40,34,36,36,40,39,39,41,38,40,34,37,38,30,30,30,26,26,36,32,42,47,47,27,30,42,27,39,39,38,38,41,37,31,31,42,39,39,37,37,34,34,33,33,40,40,38,31,44,37,38,38,35,31,32,32,36,34,34,34,36,32,41,41,46,46,34,33,33,40,35,43,32,38,38,32,35,35,37,34,40,38,38,31,30,24,38,38,36,29,38,27,30,35,35,35,30,40,40,37,35,39,38,32,32,39,40,34,34,40,33,33,37,34,34,35,25,37,37,32,31,31,39,39,33,37,37,34,35,43,43,39,41,38,32,36,36,44,37,35,41,41,41,36,32,33,33,40,40,39,39,35,40,41,31,33,33,33,32,38,36,36,29,30,34,37,38,34,32,32,40,44,44,39,43,36,36,34,41,34,26,20,20,30,34,36,34,34,30,33,26,26,33,31,37,37,33,34,35,34,35,35,43,43,44,32,37,38,36,36,34,34,37,37,37,36,29,29,41,40,38,33,37,37,35,35,26,26,35,37,37,39,33,37,27,38,38,30,39,40,40,32,36,36,39,35,42,35,39,37,29,45,45,33,33,30,30,31,35,30,32,32,40,40,42,42,27,46,35,38,32,31,35,32,32,39,38,38,36,32,30,30,30,34,34,37,33,34,29,35,30,30,34,37,37,37,40,29,44,44,27,27,31,40,40,36,34,34,42,34,34,37,23,23,39,38,38,39,39,28,32,40,38,33,33,36,34,34,45,49,43,43,34,34,38,38,37,37,33,28,44,44,35,28,42,34,34,35,34,34,34,40,33,37,37,44,44,34,47,38,38,29,29,43,36,40,40,30,38,30,41,41,29,29,35,39,31,31,28,33,39,36,36,38,22,36,38,38,31,34,29,27,39,30,30,40,40,34,34,36,32,40,40,40,36,40,40,34,34,40,31,31,34,32,32,32,30,38,41,41,40,36,30,37,37,41,34,32,34,34,47,38,38,31,38,38,45,34,38,34,40,37,31,30,30,39,39,36,36,40,37,38,30,30,47,40,40,32,34,28,32,38,38,30,35,36,39,29,54,54,36,35,35,33,37,35,35,30,33,43,30,37,35,26,35,34,34,38,38,32,37,29,41,33,33,37,38,35,30,30,26,26,38,38,38,29,45,30,35,33,40,40,40,34,42,40,32,33,33,40,46,46,39,39,38,38,33,33,37,37,34,34,30,32,32,38,38,35,35,44,44,31,45,45,31,31,31,32,38,38,39,40,39,23,45,31,31,30,30,41,43,40,40,45,35,35,33,38,38,32,35,33,32,31,35,35,40,27,27,32,21,36,34,42,34,38,46,37,38,39,37,36,30,38,38,43,43,38,32,32,41,41,35,35,26,40,36,36,28,28,30,30,37,37,34,34,47,47,27,36,36,36,36,40,40,34,36,40,40,36,39,39,41,38,36,40,34,34,37,38,30,30,30,30,26,36,32,32,42,42,47,27,30,30,36,42,42,27,27,39,39,38,41,41,37,31,31,33,37,39,39,37,37,34,34),
                               
                               
                                x2 = c(0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,0,1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,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1,0,1,1,0,0,0,0,1,1,0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,0,1,1,0,1,0,0,1,1,1,0,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,0))
Inits

                list(beta=c(0,0,0,0,0))





BUGS CODE 5.2

# x1 is age

#x2 is location

# x3 is test a vs b

# r is the false positive rate

model;
            {
for( i in 1 : N ) {
r[i] ~ dbern(p[i])
# the logistic link
logit( p[i]) <-(beta[1] + beta[2]*x1[i]+beta[3]*x2[i]+beta[4]*x3[i]+ beta[5]*x2[i]*x3[i])
           
               }
              
phat <- mean(p[])
for (i in 1:5 ){

           
beta[i] ~ dnorm(0.0,0.0001)}
           
A<-exp(beta[2])
B<-exp(beta[3])
C<-exp(beta[4])
D<-exp(beta[5])        
            }
             list( r = c(1,0,0,0,1,1,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,1,0,1,0,0,1,0,0,1,1,1,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,1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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
                               
                                x1 = c(35,33,33,38,40,40,38,38,31,44,44,37,38,38,35,31,40,32,32,32,31,34,36,32,41,46,30,33,33,40,43,32,32,38,38,35,37,34,34,32,40,38,38,35,30,24,38,38,29,34,27,30,35,35,35,30,40,40,37,35,39,39,32,32,32,39,35,34,33,33,37,34,25,37,32,31,39,39,33,37,37,34,43,39,39,34,41,46,38,35,32,36,36,44,42,33,37,35,41,41,41,41,30,36,40,33,40,40,39,39,35,41,33,33,33,33,38,36,36,29,30,34,37,38,38,34,32,32,40,40,44,44,39,43,43,36,26,41,41,34,34,20,30,34,34,36,34,34,33,33,26,26,33,37,37,33,33,34,35,35,43,43,44,31,38,36,34,37,37,37,37,36,29,29,32,41,38,33,33,36,37,37,35,31,26,25,35,35,25,37,48,33,37,41,27,38,38,39,40,40,32,36,36,39,39,35,35,39,33,37,45,45,33,33,39,30,30,31,31,35,35,30,32,32,40,40,36,33,42,42,27,46,46,35,31,35,31,32,32,39,34,39,38,36,32,30,30,34,34,37,37,38,29,35,30,30,30,34,37,37,36,37,38,40,40,29,44,44,27,31,31,40,36,36,34,34,42,34,34,38,37,40,37,34,37,23,24,38,38,39,28,32,40,38,33,33,36,34,39,34,45,43,43,31,34,34,38,37,37,36,33,35,28,44,44,28,28,42,34,34,34,34,44,40,33,30,37,44,44,34,34,47,26,38,38,29,29,43,43,40,42,36,40,40,35,37,30,27,41,41,29,29,29,35,39,39,31,42,28,36,36,38,37,31,31,34,29,27,39,30,40,40,34,36,32,40,30,43,40,36,36,40,40,36,44,34,34,32,40,40,31,31,31,34,34,32,46,38,32,32,41,41,40,36,36,30,30,32,38,37,37,41,34,34,32,34,34,47,38,31,38,34,34,36,34,34,40,37,30,39,36,36,40,40,37,37,32,38,30,28,30,30,47,40,34,34,32,38,30,39,29,54,54,28,36,35,35,37,35,35,43,31,37,35,26,29,42,35,34,45,38,38,32,37,41,41,33,36,47,37,38,27,30,
                                26,26,38,29,38,45,30,38,33,32,40,39,40,42,34,34,42,40,32,32,33,33,40,46,40,39,38,38,33,33,37,37,34,30,32,32,31,38,38,35,44,44,45,45,31,31,31,32,32,49,38,39,39,39,23,31,31,30,27,40,40,45,35,33,38,38,32,31,35,35,32,27,32,21,21,34,34,42,34,38,46,37,39,39,37,36,31,38,38,43,43,31,32,37,32,32,41,41,35,35,31,27,36,34,28,30,30,37,34,47,47,27,32,36,36,36,36,40,40,34,36,36,40,39,39,41,38,40,34,37,38,30,30,30,26,26,36,32,42,47,47,27,30,42,27,39,39,38,38,41,37,31,31,42,39,39,37,37,34,34,33,33,40,40,38,31,44,37,38,38,35,31,32,32,36,34,34,34,36,32,41,41,46,46,34,33,33,40,35,43,32,38,38,32,35,35,37,34,40,38,38,31,30,24,38,38,36,29,38,27,30,35,35,35,30,40,40,37,35,39,38,32,32,39,40,34,34,40,33,33,37,34,34,35,25,37,37,32,31,31,39,39,33,37,37,34,35,43,43,39,41,38,32,36,36,44,37,35,41,41,41,36,32,33,33,40,40,39,39,35,40,41,31,33,33,33,32,38,36,36,29,30,34,37,38,34,32,32,40,44,44,39,43,36,36,34,41,34,26,20,20,30,34,36,34,34,30,33,26,26,33,31,37,37,33,34,35,34,35,35,43,43,44,32,37,38,36,36,34,34,37,37,37,36,29,29,41,40,38,33,37,37,35,35,26,26,35,37,37,39,33,37,27,38,38,30,39,40,40,32,36,36,39,35,42,35,39,37,29,45,45,33,33,30,30,31,35,30,32,32,40,40,42,42,27,46,35,38,32,31,35,32,32,39,38,38,36,32,30,30,30,34,34,37,33,34,29,35,30,30,34,37,37,37,40,29,44,44,27,27,31,40,40,36,34,34,42,34,34,37,23,23,39,38,38,39,39,28,32,40,38,33,33,36,34,34,45,49,43,43,34,34,38,38,37,37,33,28,44,44,35,28,42,34,34,35,34,34,34,40,33,37,37,44,44,34,47,38,38,29,29,43,36,40,40,30,38,30,41,41,29,29,35,39,31,31,28,33,39,36,36,38,22,36,38,38,31,34,29,27,39,30,30,40,40,34,34,36,32,40,40,40,36,40,40,34,34,40,31,31,34,32,32,32,30,38,41,41,40,36,30,37,37,41,34,32,34,34,47,38,38,31,38,38,45,34,38,34,40,37,31,30,30,39,39,36,36,40,37,38,30,30,47,40,40,32,34,28,32,38,38,30,35,36,39,29,54,54,36,35,35,33,37,35,35,30,33,43,30,37,35,26,35,34,34,38,38,32,37,29,41,33,33,37,38,35,30,30,26,26,38,38,38,29,45,30,35,33,40,40,40,34,42,40,32,33,33,40,46,46,39,39,38,38,33,33,37,37,34,34,30,32,32,38,38,35,35,44,44,31,45,45,31,31,31,32,38,38,39,40,39,23,45,31,31,30,30,41,43,40,40,45,35,35,33,38,38,32,35,33,32,31,35,35,40,27,27,32,21,36,34,42,34,38,46,37,38,39,37,36,30,38,38,43,43,38,32,32,41,41,35,35,26,40,36,36,28,28,30,30,37,37,34,34,47,47,27,36,36,36,36,40,40,34,36,40,40,36,39,39,41,38,36,40,34,34,37,38,30,30,30,30,26,36,32,32,42,42,47,27,30,30,36,42,42,27,27,39,39,38,41,41,37,31,31,33,37,39,39,37,37,34,34),
                               
                               
                                x2 = c(0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,1,0,0,0,1,0,0,1,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,1,0,0,1,1,1,0,0,1,1,1,1,1,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,1,0,0,1,1,1,0,0,1,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,1,0,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0,0,0,1,1,1,0,1,1,0,0,1,0,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,1,0,1,1,0,0,0,0,1,0,1,1,1,1,0,0,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1,0,1,1,0,0,0,0,1,1,0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,0,1,1,0,1,0,0,1,1,1,0,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,0,0))
Inits

                list(beta=c(0,0,0,0,0))



BUGS CODE 5.3

Model;
{
for( i in 1 : M ) {
fp[i] ~ dbern(p[i])
p[i] <- exp(beta[1] + beta[2] * x5[i])
}
for(i in 1:N) { tp[i]~dbern(q[i])
q[i]<-exp(alpha[1]+alpha[2]*x4[i])
}
tphat<-mean(q[])
fphat <- mean(p[])
for (i in 1:2 ){

beta[i] ~ dnorm(0.0,0.0001)
alpha[i] ~dnorm(0.0,0.0001)
}
A<-exp(alpha[2])
B<-exp(beta[2])
rpdlrab <- exp(alpha[2]-beta[2])
pdlr<-tphat/fphat
}




BUGS CODE 5.4


model;

{

# ROC area
# Holtbrugge and Schumacher Study
# code is from Congdon

# non diseased patients
for(i in 1:151){for(j in 1:4){logit(ndgamma[i,j])<-ndtheta[j]-ndmu[i]}}

for(i in 1:151){ndp[i,1]<-ndgamma[i,1]}

for(i in 1:151){ndp[i,2]<-ndgamma[i,2]-
ndgamma[i,1]}

for(i in 1:151){ndp[i,3]<-ndgamma[i,3]-
ndgamma[i,2]}

for(i in 1:151){ndy[i]~dcat(ndp[i,1:4])}

for(i in 1:151){ndp[i,4]<-1-ndgamma[i,3]}

# intercept depends on y
for(i in 1:151){
ndmu[i]<-ndb0[ndy[i]]+ndx1[i]*ndb[1]
}
# prior distribution for the regression coefficients

ndb[1]~dnorm(0,.0001)
for(i in 1:4){ndb0[i]~dnorm(0,.001)}
# the following give the cut points for the latent variable
ndtheta[1]~dnorm(0,1)
ndtheta[2]~dnorm(0,1)
ndtheta[3]~dnorm(0,1)
ndtheta[4]~dnorm(0,1)I(ndtheta[3],)
# the ndq[i] are the probabilities of  the responses for non diseased
for( i in 1:4){ndq[i]<-mean(ndp[,i])}

# diseased patients

for(i in 1:148){for(j in 1:4){logit(dgamma[i,j])<-dtheta[j]-dmu[i]}}

for(i in 1:148){dp[i,1]<-dgamma[i,1]}

for(i in 1:148){dp[i,2]<-dgamma[i,2]-
dgamma[i,1]}

for(i in 1:148){dp[i,3]<-dgamma[i,3]-
dgamma[i,2]}

for(i in 1:148){dp[i,4]<-1-
dgamma[i,3]}

for(i in 1:148){dy[i]~dcat(dp[i,1:4])}
# intercept depends on y
for(i in 1:148){
dmu[i]<-db0[dy[i]]+dx1[i]*db[1]}
# prior distributions for the regression coefficients
db[1]~dnorm(0,.0001)
for(i in 1:4){db0[i]~dnorm(0,.001)}
# the following dtheta are the cut points for the underlying latent variable
dtheta[1]~dnorm(0,1)
dtheta[2]~dnorm(0,1)
dtheta[3]~dnorm(0,1)
dtheta[4]~dnorm(0,1)I(dtheta[3],)
# the dq[i] are the probabilities of the four ordinal responses for diseased
for( i in 1:4){dq[i]<-mean(dp[,i])}
# roc area
area<-a1+a2/2

a1<-dq[2]*ndq[1]+dq[3]*(ndq[1]+ndq[2])+
dq[4]*(ndq[1]+ndq[2]+ndq[3])
# a2 is the probability of a tie
a2<-dq[1]*ndq[1]+dq[2]*ndq[2]+dq[3]*ndq[3]+
dq[4]*ndq[4]

}

list( 
# for sequential therapy
ndy=c(1,1,1,1,1,1,1,1,1,1,1,1,
          1,1,1,1,1,1,1,1,1,1,1,1,
          1,1,1,1,

          2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
          2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
          2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

          3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
          3,3,3,3,3,3,3,3,3,3,3,3,3,3,

          4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
          4,4,4,4,4,4,4,4,4,4,4,
        
          1,1,1,1,

          2,2,2,2,2,2,2,2,2,2,2,2,

          3,3,3,3,3,

          4,4),  
           
ndx1=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,


            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0),

 

  
# data for diseased
# for alternating therapy

dy=c(

        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,

        2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,

        3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
        3,3,3,3,3,

        4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
        4,4,4,4,4,


        1,1,1,1,1,1,1,1,1,1,1,1,   

        2,2,2,2,2,2,2,

        3,3,3,  

        4),


dx1=c(

            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,

            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0))

   
                     
# initial values         

list(ndtheta=c(0,0,0,0),dtheta=c(0,0,0,0))

# initialize other values  


BUGS CODE 5.5

model;

{

# 4 readers
 # ROC area
# melanoma example
# code is from Congdon

# non diseased

for(i in 1:30){for(j in 1:5){logit(ndgamma[i,j])<-ndtheta[j]-ndmu[i]}}

for(i in 1:30){ndp[i,1]<-ndgamma[i,1]}

for(i in 1:30){ndp[i,2]<-ndgamma[i,2]-
ndgamma[i,1]}
for(i in 1:30){ndp[i,3]<-ndgamma[i,3]-
ndgamma[i,2]}

for(i in 1:30){ndp[i,4]<-ndgamma[i,4]-
ndgamma[i,3]}

for(i in 1:30){ndy[i]~dcat(ndp[i,1:5])}

for(i in 1:30){ndp[i,5]<-1-ndgamma[i,4]}

# intercept depends on y
for(i in 1:30){
ndmu[i]<-ndb0[ndy[i]]+ ndx1[i]*ndb[1]+ndx2[i]*ndb[2]+ndx3[i]*ndb[3]}

for(i in 1:3){ndb[i]~dnorm(0,.001)}
for(i in 1:5){ndb0[i]~dnorm(0,.001)}
ndtheta[1]~dnorm(0,1)
ndtheta[2]~dnorm(0,1)
ndtheta[3]~dnorm(0,1)
ndtheta[4]~dnorm(0,1)
ndtheta[5]~dnorm(0,1)I(ndtheta[4],)

for( i in 1:5){ndq[i]<-mean(ndp[,i])}

# diseased population

for(i in 1:50){for(j in 1:5){logit(dgamma[i,j])<-dtheta[j]-dmu[i]}}

for(i in 1:50){dp[i,1]<-dgamma[i,1]}

for(i in 1:50){dp[i,2]<-dgamma[i,2]-
dgamma[i,1]}

for(i in 1:50){dp[i,3]<-dgamma[i,3]-
dgamma[i,2]}

for(i in 1:50){dp[i,4]<-dgamma[i,4]-
dgamma[i,3]}

for(i in 1:50){dy[i]~dcat(dp[i,1:5])}

for(i in 1:50){dp[i,5]<-1-dgamma[i,4]}

# intercept depends on y
for(i in 1:50){
dmu[i]<-db0[dy[i]]+ dx1[i]*db[1]+dx2[i]*db[2]+dx3[i]*db[3]}

for(i in 1:3){db[i]~dnorm(0,.001)}
for(i in 1:5){db0[i]~dnorm(0,.001)}
dtheta[1]~dnorm(0,1)
dtheta[2]~dnorm(0,1)
dtheta[3]~dnorm(0,1)
dtheta[4]~dnorm(0,1)
dtheta[5]~dnorm(0,1)I(dtheta[4],)

for( i in 1:5){dq[i]<-mean(dp[,i])}
# roc area

area<-a1+a2/2

a1<-dq[2]*ndq[1]+dq[3]*(ndq[1]+ndq[2])+
dq[4]*(ndq[1]+ndq[2]+ndq[3])+
dq[5]*(ndq[1]+ndq[2]+ndq[3]+ndq[4])

a2<-dq[1]*ndq[1]+dq[2]*ndq[2]+dq[3]*ndq[3]+
dq[4]*ndq[4]+dq[5]*ndq[5]

}

list( 

ndy=c(1,1,1,1,1,1,1,1,1,1,1,1,
           2,2,2,2,2,2,2,2,2,2,
           3,3,3,3,3,
           4,4,
           5,
   
          1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
          2,2,2,2,2,2,2,
          3,3,3,3,
          4,4,4,
          5,

         1,1,1,1,1,1,1,1,1,1,1,
         2,2,2,2,2,2,2,2,2,
         3,3,
         4,4,4,
         5,5,5,5,5,

        1,1,1,1,1,1,1,1,1,1,1,1,1,
        2,2,2,2,2,2,2,2,
        3,3,3,3,3,3,
        4,4,
        5     
    
    ),
       

ndx1=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,

   
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,

        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,

        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0   

        ),


ndx2=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,

            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,

            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,

            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0

       ),

ndx3=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,

           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
           0,0,0,0,0,0,0,0,0,0,

            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,1,1,1,1,1,1,1,1,1,

            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0

        ),

# data for diseased

dy=c(1,1,1,
         2,2,2,2,2,2,2,
         3,3,3,3,3,3,3,3,3,3,3,
         4,4,4,4,4,4,4,4,4,4,4,4,4,
         5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
    
        1,1,
        2,2,2,2,2,2,2,2,
        3,3,3,3,3,3,3,3,3,3,
        4,4,4,4,4,4,4,4,4,4,4,4,
        5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,

        1,1,1,1,1,1,1,
        2,2,2,2,2,2,2,2,2,2,
        3,3,3,3,3,3,
        4,4,4,4,4,4,4,4,4,4,
        5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,

        1,1,1,1,1,1,1,1,1,1,
        2,2,2,2,2,2,
        3,3,3,3,3,3,3,3,
        4,4,4,4,4,4,4,4,4,4,4,4,4,4,
        5,5,5,5,5,5,5,5,5,5,5,5  

      ),
       

dx1=c(
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,

       
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,

        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,
      
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0

       ),


dx2=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,

        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,

        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,

          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0
       
    
        ),

dx3=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,

          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
          0,0,0,0,0,0,0,0,0,0,

        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,

         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
         0,0,0,0,0,0,0,0,0,0     
      ))  
         

list(ndtheta=c(0,0,0,0,0),dtheta=c(0,0,0,0,0))

BUGS CODE 5.6
model;
# Binormal model with  interaction between the true disease state and the covariates.
# Calculates posterior distribution of model parameters and the area under curve. 
{
# likelihood function
          for(i in 1:N) {
         
          # log of y is yt
              yt[i]<-log(y[i])
         
                   yt[i]~dnorm(mu[i],precy[d[i]+1]);
#                 yt[i] <- log(y[i]); # logarithmic transformation

# the regression function
                   mu[i] <- beta[1] + beta[2]*d[i]+beta[3]*age[i]+beta[4]*d[i]*age[i]             
                                      }                                    
# prior distributions - non-informative prior
          for(i in 1:P) {       
                   beta[i] ~ dnorm(0, 0.000001);          
                             }                                    
          for(i in 1:K) {      
                   precy[i]~dgamma(0.001, 0.001);
                   vary[i] <- 1.0/precy[i];
                                      }                
# calculates area under the curve
          la1 <- beta[2]/sqrt(vary[1]);
          la2 <- vary[2]/vary[1];
          auc <- phi(la1/sqrt(1+la2));    
}

# psa data from Etzioni et al.

list(K=2, P=4, N=683, y=c(.03,
.09,.23,.27,.27,.29,.29,.29,.30,.31,.33,.35,.37,.37,.42,.43,.44,.45,
.45,.46,.46,.47,.47,.48,.49,.49,.50,.50,.50,.51,.51,.55,.55,.56,.57,
.57,.58,.58,.58,.58,.59,.59,.59,.61,.61,.62,.62,.63,.63,.64,.64,.64,
.64,.65,.65,.65,.66,.66,.66,.66,.66,.66,.67,.67,.67,.67,.67,.68,.68,
.69,.69,.69,.69,.69,.70,.71,.72,.72,.73,.74,.74,.75,.75,.75,.75,.75,
.76,.76,.77,.77,.77,.77,.77,.77,.78,.78,.78,.78,.78,.78,.79,.79,.79,
.79,.80,.80,.80,.81,.81,.81,.81,.82,.83,.83,.84,.85,.86,.87,.87,.87,
.87,.87,.88,.89,.89,.89,.89,.89,.92,.92,.92,.93,.93,.93,.93,.93,.93,
.94,.94,.95,.95,.95,.95,.96,.96,.97,.97,.98,.98,.98,.98,.98,.99,1.00,1.00,
1.00,1.01,1.01,1.02,1.03,1.03,1.03,1.03,1.03,1.03,1.04,1.04,1.04,
1.04,1.04,1.05,1.05,1.05,1.05,1.06,1.06,1.06,1.06,1.07,1.07,1.07,
1.08,1.08,1.08,1.11,1.11,1.12,1.12,1.13,1.13,1.13,1.14,1.15,1.15,
1.15,1.15,1.15,1.15,1.15,1.15,1.16,1.16,1.16,1.17,1.17,1.17,1.17,
1.18,1.18,1.18,1.18,1.18,1.19,1.19,1.19,1.20,1.20,1.21,1.22,1.22,
1.22,1.23,1.23,1.24,1.24,1.24,1.25,1.25,1.25,1.25,1.25,1.25,1.26,
1.26,1.26,1.27,1.27,1.27,1.27,1.27,1.27,1.28,1.28,1.29,1.30,1.30,
1.31,1.31,1.32,1.32,1.33,1.34,1.35,1.35,1.35,1.35,1.35,1.35,1.35,
1.36,1.37,1.37,1.37,1.38,1.39,1.39,1.40,1.40,1.40,1.40,1.41,1.41,
1.41,1.41,1.41,1.41,1.43,1.43,1.43,1.43,1.44,1.44,1.45,1.46,1.46,
1.47,1.47,1.47,1.48,1.48,1.49,1.49,1.50,1.50,1.50,1.50,1.51,
1.51,1.51,1.51,1.53,1.54,1.54,1.55,1.55,1.56,1.57,1.57,1.58,1.58,
1.58,1.61,1.62,1.62,1.62,1.62,1.64,1.67,1.67,1.67,1.67,1.67,1.68,
1.69,1.69,1.70,1.70,1.70,1.71,1.71,1.71,1.71,1.71,1.71,1.71,1.71,
1.73,1.73,1.73,1.74,1.79,1.80,1.80,1.83,1.85,1.85,1.88,1.88,1.88,
1.89,1.89,1.89,1.91,1.91,1.91,1.92,1.93,1.93,1.94,1.95,1.96,2.01,
2.01,2.03,2.03,2.03,2.04,2.04,2.05,2.05,2.06,2.07,2.08,2.08,2.10,
2.11,2.13,2.13,2.14,2.16,2.17,2.19,2.19,2.19,2.22,2.22,2.23,2.24,
2.27,2.27,2.27,2.28,2.28,2.29,2.29,2.30,2.30,2.33,2.34,2.34,2.35,
2.36,2.36,2.37,2.40,2.41,2.42,2.43,2.43,2.43,2.43,2.46,2.50,2.50,
2.51,2.51,2.52,2.53,2.55,2.55,2.56,2.56,2.57,2.58,2.61,2.62,2.62,
2.63,2.63,2.63,2.66,2.69,2.70,2.71,2.73,2.77,2.79,2.82,2.82,2.82,
2.83,2.84,2.84,2.85,2.86,2.86,2.87,2.88,2.88,2.90,2.92,2.92,2.93,
2.95,2.96,2.96,2.96,2.97,2.98,3.03,3.03,3.04,3.05,3.05,3.08,3.10,
3.11,3.13,3.17,3.17,3.18,3.20,3.21,3.24,3.25,3.25,3.29,3.30,3.30,
3.32,3.32,3.33,3.34,3.35,3.38,3.41,3.42,3.43,3.45,3.51,3.55,3.57,
3.57,3.58,3.58,3.61,3.65,3.65,3.66,3.68,3.69,3.70,3.73,3.77,3.78,
3.78,3.78,3.80,3.84,3.88,3.89,3.95,3.97,3.97,4.00,4.03,4.03,4.04,
4.05,4.08,4.12,4.15,4.19,4.20,4.20,4.20,4.30,4.33,4.34,4.38,4.39,
4.40,4.41,4.44,4.47,4.47,4.48,4.52,4.54,4.60,4.62,4.64,4.70,4.75,
4.75,4.76,4.78,4.90,4.90,4.93,4.94,4.98,5.02,5.09,5.10,5.11,5.12,
5.13,5.13,5.25,5.28,5.37,5.39,5.44,5.44,5.53,5.54,5.64,5.65,5.67,
5.73,5.75,5.81,5.85,6.07,6.07,6.16,6.18,6.27,6.29,6.31,6.41,6.48,6.48,
6.50,6.52,6.52,6.54,6.54,6.56,6.56,6.77,6.92,6.93,7.09,7.19,7.21,
7.23,7.24,7.28,7.29,7.42,7.43,7.53,7.59,7.64,7.78,7.90,8.04,8.15,
8.31,8.37,8.57,8.62,8.69,9.07,9.11,9.15,9.15,9.17,9.24,9.30,9.33,
9.76,9.94,9.96,9.97,10.11,10.60,10.71,10.92,11.33,11.40,11.54,
11.62,11.65,12.69,12.69,13.61,13.94,14.82,15.41,15.84,15.84,15.89,
16.18,16.48,16.70,16.81,17.10,17.17,17.57,19.35,20.10,20.24,20.47,
20.53,21.48,22.50,23.81,24.63,25.06,26.67,27.68,29.31,31.46,33.02,
35.93,37.63,37.66,38.39,43.30,48.80,49.16,51.72,61.16,72.07,79.21,
90.66,99.97,99.98,99.98,99.98),

# disease statius

d=c(.00,1.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
1.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,1.00,.00,.00,1.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,1.00,
.00,1.00,.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,1.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,1.00,1.00,.00,.00,1.00,.00,.00,.00,
.00,1.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,1.00,.00,.00,.00,.00,.00,.00,.00,1.00,1.00,.00,.00,1.00,.00,
1.00,1.00,.00,.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,.00,.00,
.00,.00,1.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,1.00,.00,.00,.00,.00,1.00,1.00,.00,.00,1.00,1.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,1.00,1.00,.00,.00,
.00,.00,.00,.00,.00,.00,.00,.00,.00,1.00,.00,.00,1.00,.00,.00,.00,.00,
.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,.00,1.00,.00,.00,.00,.00,
.00,.00,1.00,1.00,.00,.00,1.00,.00,.00,.00,.00,1.00,.00,1.00,.00,.00,
.00,.00,1.00,1.00,.00,.00,.00,.00,.00,1.00,.00,1.00,.00,.00,.00,.00,.00,
.00,.00,.00,.00,1.00,1.00,1.00,.00,1.00,.00,.00,.00,1.00,1.00,.00,.00,.00,
.00,1.00,.00,.00,.00,.00,.00,1.00,1.00,.00,1.00,.00,1.00,.00,1.00,.00,
.00,.00,1.00,.00,.00,.00,.00,.00,.00,.00,.00,.00,1.00,1.00,.00,1.00,.00,
1.00,.00,1.00,.00,1.00,.00,.00,1.00,.00,1.00,.00,.00,.00,1.00,1.00,.00,.00,
.00,.00,.00,1.00,1.00,.00,.00,.00,1.00,.00,1.00,1.00,.00,1.00,1.00,.00,
1.00,.00,.00,.00,1.00,.00,.00,.00,.00,1.00,1.00,.00,1.00,.00,.00,.00,
1.00,.00,1.00,.00,.00,1.00,.00,1.00,.00,.00,.00,1.00,.00,1.00,1.00,.00,
1.00,.00,.00,1.00,1.00,.00,.00,1.00,.00,1.00,.00,.00,.00,.00,.00,.00,
.00,1.00,1.00,.00,1.00,1.00,.00,1.00,.00,1.00,1.00,.00,.00,.00,1.00,1.00,
.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,.00,1.00,1.00,1.00,
1.00,.00,1.00,1.00,1.00,1.00,.00,.00,.00,.00,1.00,1.00,1.00,1.00,.00,
1.00,1.00,.00,1.00,.00,1.00,1.00,1.00,.00,1.00,.00,.00,.00,1.00,1.00,
.00,1.00,1.00,1.00,1.00,.00,1.00,.00,1.00,1.00,1.00,.00,1.00,1.00,.00,
.00,.00,1.00,.00,1.00,1.00,1.00,.00,1.00,.00,1.00,.00,1.00,1.00,.00,
1.00,1.00,1.00,.00,1.00,.00,1.00,.00,1.00,.00,.00,1.00,1.00,1.00,.00,
1.00,1.00,1.00,.00,1.00,.00,1.00,1.00,1.00,1.00,.00,1.00,1.00,.00,1.00,
1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,
1.00,1.00,1.00,1.00,.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,
1.00,1.00,1.00,1.00,1.00,.00,1.00,1.00,.00,1.00,.00,1.00,1.00,1.00,
1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,.00,1.00,1.00,
1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00),

age=c(68,70,73,74,55,57,58,59,60,61,62,63,64,57,60,62,63,68,
69,70,71,72,72,58,57,59,61,68,71,58,61,62,63,64,65,66,
67,65,69,61,64,65,66,67,58,61,62,63,53,56,58,60,63,64,
62,65,66,67,68,71,72,53,54,58,60,61,63,64,65,64,65,66,
68,70,71,68,61,63,65,67,69,70,72,58,61,62,63,64,65,66,
67,67,70,71,72,74,75,76,63,66,67,68,69,70,71,72,73,58,
62,61,65,66,67,68,70,53,55,57,62,64,66,57,59,60,61,62,
63,64,65,66,48,50,52,57,61,62,63,64,65,66,67,68,70,72,
54,57,59,62,64,65,66,67,68,69,70,71,58,61,62,63,64,65,
66,67,68,64,66,66,69,70,57,63,64,65,66,67,58,62,64,64,
65,66,67,58,62,63,64,65,67,68,61,63,65,56,57,58,60,62,
63,75,77,78,55,58,59,60,62,65,69,70,71,72,73,74,75,54,
56,57,59,61,62,57,59,61,62,65,66,67,63,65,67,55,57,58,
59,60,62,63,65,67,70,65,67,68,69,70,61,64,65,66,67,68,
61,59,61,62,63,65,66,67,68,59,62,63,64,65,58,61,62,63,
64,65,66,67,70,74,75,76,53,55,57,57,58,59,61,63,64,50,
52,53,54,55,56,57,58,59,65,67,67,68,69,70,71,72,54,56,
58,60,56,59,60,61,69,71,73,70,71,72,73,74,63,65,66,57,
60,62,63,61,65,74,78,79,80,81,61,65,66,66,67,68,71,61,
58,62,63,64,65,66,67,68,68,67,68,69,71,72,65,69,70,73,
74,59,64,65,56,60,67,70,72,72,57,68,71,73,75,61,64,68,
69,56,59,60,61,62,64,66,68,50,53,54,55,57,58,60,61,62,
63,65,67,68,65,68,69,63,66,67,68,69,70,71,72,64,68,70,
71,72,73,58,62,63,63,63,64,66,66,68,53,55,56,57,58,65,
67,68,69,70,71,72,73,75,72,76,77,78,80,59,62,63,64,65,
66,49,52,53,54,55,56,57,58,65,67,69,57,58,59,61,63,64,
58,61,62,63,64,65,66,67,68,54,57,59,67,69,71,56,60,61,
62,63,65,55,59,64,64,67,69,70,71,72,73,74,52,54,61,65,
67,70,71,71,72,66,69,70,71,72,73,74,75,76,62,71,72,73,
74,75,76,77,70,71,72,73,61,65,67,57,60,60,62,62,63,64,
65,66,70,71,72,74,75,76,62,64,65,65,68,69,69,70,71,60,
63,64,68,72,74,67,71,72,73,74,75,76,59,62,63,64,65,66,
67,68,69,64,67,68,68,69,70,72,73,74,60,47,51,52,53,54,
55,69,71,66,68,71,72,68,70,60,63,64,65,69,71,73,75,51,
53,55,65,69,70,76,58,64,66,67,65,68,70,62,63,64,65,66,
67,65,67,68,69,70,62,66,67,61,64,65,66,67,69,70,71,66,
69,70,71,72,73,59,63,64,65,66,68,69,69,60,63,65,66,67,
68,69,63,65,66,67,68,70,65,66,67,50,53,55,57,58,71))

# initial values

                            list(beta=c(0,0,0,0), precy=c(1,1))




BUGS CODE 5.7

model;

# Calculates posterior distribution of model parameters and the area under curve.  y=test
{
# likelihood function

          for(i in 1:N) {
         
                   yt[i]~dnorm(mu[i],precy[d[i]+1]);
                   yt[i] <--(y[i]);

# d is the disease indicator
#amt is the threshold of the stimulus
#f is the frequency
# int is the intensity      
# this is the regression function       
                   mu[i] <- beta[1] + beta[2]*d[i]+beta[3]*amt[i]+   beta[4]*f[i]+beta[5]*int[i]+beta[6]*d[i]*amt[i]+beta[7]*d[i]*f[i]+beta[8]*d[i]*int[i]                                                         }                                    
# prior distributions - non-informative prior; similarly for informative priors

          for(i in 1:8){
         
                   beta[i] ~ dnorm(0, 0.0001);
                  
                                      }                                    
          for(i in 1:2 ){
         
                   precy[i]~dgamma(0.001, 0.001);
                   vary[i] <- 1.0/precy[i];

                                      }                
# calculates area under the curve

          la1 <- beta[2]/sqrt(vary[1]); # ROC curve parameters
          la2 <- vary[2]/vary[1];
          auc <- phi(la1/sqrt(1+la2));
         
}





BUGS CODE 5.8

model;

# Calculates posterior distribution of model parameters and the area under curve. 
{
# likelihood function

          for(i in 1:N) {
         
                   g[i]~dnorm(mu[i],precy[d[i]+1]);
                   mu[i] <- beta[1] + beta[2]*d[i] +       beta[3]*age[i]+beta[4]*male[i] ;
                  
                                      }
                                     
# prior distributions - non-informative prior; similarly for informative priors

          for(i in 1:P) {
         
                   beta[i] ~ dnorm(0, 0.001);
                  
                                      }
                                     
          for(i in 1:K) {
         
                   precy[i]~dgamma(0.001, 0.001);
                   vary[i] <- 1.0/precy[i];

                                      }
                  
# calculates area under the curve

          la1 <- beta[2]/sqrt(vary[1]); # ROC curve parameters
          la2 <- vary[2]/vary[1];
          auc <- phi(la1/sqrt(1+la2));
         
}

list(P=4,N=307, K=2, g=c(96.63,102.98,97.72,97.82,106.94,105.32,92.61,94.99,
105.49,97.34,97.72,96.87,98.53,102.57,99.69,96.46,93.68,
97.46,104.60,98.49,107.34,96.03,105.17,96.87,98.16,
104.14,99.73,94.68,93.85,99.70,95.07,99.74,102.22,98.99,
103.72,101.55,101.55,95.54,97.47,103.37,100.31,100.55,
99.76,103.12,92.16,106.42,102.03,96.97,103.79,96.58,
113.96,100.26,95.07,104.00,101.47,105.84,103.61,98.03,
93.45,92.92,98.48,100.14,97.46,97.88,104.21,92.92,
104.49,95.51,100.49,99.46,105.03,91.78,100.75,105.68,
100.31,91.27,103.92,98.78,92.80,107.75,104.85,104.24,
93.57,100.69,97.11,101.41,84.43,101.88,94.94,94.91,
100.04,104.18,104.81,98.06,107.01,94.13,99.19,98.87,
99.01,96.42,103.26,109.30,97.20,94.74,103.36,103.82,
93.54,97.27,96.29,100.58,102.62,94.51,101.84,98.10,
102.66,99.73,96.50,104.86,100.69,97.57,101.81,98.88,
101.00,100.48,98.99,108.75,105.34,108.13,100.90,105.06,
98.10,106.16,105.64,94.18,104.07,98.64,97.82,98.49,
100.74,100.63,93.91,94.89,103.31,102.42,98.5,196.68,
109.31,95.59,99.23,102.60,104.24,103.14,109.07,103.23,
103.72,98.41,93.53,92.92,101.26,98.75,106.58,94.80,
102.49,101.80,99.97,97.73,106.66,100.91,93.13,105.04,
101.92,91.52,107.76,94.59,97.97,98.59,104.58,107.60,
98.14,101.84,101.41,92.35,99.41,99.63,96.51,100.77,
100.67,93.19,103.83,108.11,96.35,106.37,99.29,
102.72,89.20,101.92,105.87,96.66,101.85,103.92,101.38,
95.23,99.60,98.08,99.64,111.32,108.37,91.69,95.38,98.09,
92.05,106.36,93.98,102.26,103.81,98.00,99.20,106.46,
109.58,113.86,103.72,105.94,114.61,111.08,106.89,
119.51,110.30,110.00,108.31,108.68,108.98,115.01,
113.07,114.89,109.79,105.70,114.20,113.53,113.97,
110.91,110.33,115.78,111.05,108.53,111.56,110.78,
109.71,112.18,112.05,109.46,103.84,112.23,118.56,
110.60,109.54,112.31,100.78,114.07,112.14,107.85,
111.65,105.94,108.63,109.89,107.14,108.76,110.11,
104.60,107.11,112.49,113.74,103.19,105.07,109.04,
110.45,105.02,108.27,109.17,110.37,110.92,107.53,
109.22,113.01,108.74,116.74,112.10,110.88,111.08,
110.22,111.23,112.94,99.04,113.51,107.26,110.76,
108.06,97.03,109.14,105.56,111.55,108.85,98.46,110.24,
112.22,108.57,105.95,106.30),

d =c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),

age=c(41,36,38,46,38,45,42,42,43,43,43,55,47,46,47,47,32,38,45,37,43,36,52,48,37,42,41,47,46,46,45,49,44,48,50,48,43,47,44,57,48,49,40,41,45,45,52,45,48,45,42,46,48,44,36,48,39,44,51,48,47,39,38,43,39,45,40,35,36,41,46,48,55,41,44,35,38,47,45,50,40,44,46,38,38,50,44,40,46,37,43,40,46,43,36,44,32,47,40,38,42,46,45,41,53,45,41,40,55,48,44,47,47,45,41,53,41,38,43,47,50,45,43,46,42,43,42,47,46,44,37,42,43,44,44,46,36,50,40,39,37,55,41,45,43,39,54,37,38,42,44,48,50,33,42,48,40,49,38,47,39,38,47,39,44,49,46,48,38,39,38,48,42,42,43,36,34,41,36,49,43,35,40,46,44,41,49,46,42,47,42,42,49,43,41,47,47,44,39,42,43,51,43,46,37,44,42,38,35,42,45,49,42,40,45,48,42,52,53,49,63,53,62,57,57,64,53,54,55,59,54,53,55,63,52,58,59,57,56,56,55,59,59,62,59,56,64,59,56,60,54,60,54,54,53,57,58,54,59,63,55,59,51,52,57,60,58,50,62,59,61,53,64,50,55,57,60,58,59,56,55,53,57,53,54,59,61,59,56,56,58,57,60,57,59,54,60,51,61,57,53,53,60,64,58,56,63),

male=c(1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,1,0,0,1,1,1,0,1,0,1,1,0,1,0,1,0,0,1,0,0,1,0,1,1,0,1,0,0,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,1,1,1,0,1,0,1,0,1,1,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,0,0,0,0,1,1,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,1,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,1,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,0,1,0,0,1,1,1,0))



list(beta=c(0,0,0,0), precy=c(1,1))




BUGS CODE 5.9

model;

# Calculates posterior distribution of model parameters and the area under curve. 
{
# likelihood function

          for(i in 1:N) {
         
                   g[i]~dnorm(mu[i],precy[d[i]+1]);
                   mu[i] <- beta[1] + beta[2]*d[i] +       beta[3]*age[i]+beta[4]*male[i] ;
                  
                                      }
                                     
# prior distributions - non-informative prior; similarly for informative priors

          for(i in 1:P) {
         
                   beta[i] ~ dnorm(0, 0.001);
                  
                                      }
                                     
          for(i in 1:K) {
         
                   precy[i]~dgamma(0.001, 0.001);
                   vary[i] <- 1.0/precy[i];

                                      }
                  
# calculates area under the curve

          la1 <- beta[2]/sqrt(vary[1]); # ROC curve parameters
          la2 <- vary[2]/vary[1];
          auc <- phi(la1/sqrt(1+la2));
         
}

list(P=4,N=307, K=2, g=c(96.63,102.98,97.72,97.82,106.94,105.32,92.61,94.99,
105.49,97.34,97.72,96.87,98.53,102.57,99.69,96.46,93.68,
97.46,104.60,98.49,107.34,96.03,105.17,96.87,98.16,
104.14,99.73,94.68,93.85,99.70,95.07,99.74,102.22,98.99,
103.72,101.55,101.55,95.54,97.47,103.37,100.31,100.55,
99.76,103.12,92.16,106.42,102.03,96.97,103.79,96.58,
113.96,100.26,95.07,104.00,101.47,105.84,103.61,98.03,
93.45,92.92,98.48,100.14,97.46,97.88,104.21,92.92,
104.49,95.51,100.49,99.46,105.03,91.78,100.75,105.68,
100.31,91.27,103.92,98.78,92.80,107.75,104.85,104.24,
93.57,100.69,97.11,101.41,84.43,101.88,94.94,94.91,
100.04,104.18,104.81,98.06,107.01,94.13,99.19,98.87,
99.01,96.42,103.26,109.30,97.20,94.74,103.36,103.82,
93.54,97.27,96.29,100.58,102.62,94.51,101.84,98.10,
102.66,99.73,96.50,104.86,100.69,97.57,101.81,98.88,
101.00,100.48,98.99,108.75,105.34,108.13,100.90,105.06,
98.10,106.16,105.64,94.18,104.07,98.64,97.82,98.49,
100.74,100.63,93.91,94.89,103.31,102.42,98.5,196.68,
109.31,95.59,99.23,102.60,104.24,103.14,109.07,103.23,
103.72,98.41,93.53,92.92,101.26,98.75,106.58,94.80,
102.49,101.80,99.97,97.73,106.66,100.91,93.13,105.04,
101.92,91.52,107.76,94.59,97.97,98.59,104.58,107.60,
98.14,101.84,101.41,92.35,99.41,99.63,96.51,100.77,
100.67,93.19,103.83,108.11,96.35,106.37,99.29,
102.72,89.20,101.92,105.87,96.66,101.85,103.92,101.38,
95.23,99.60,98.08,99.64,111.32,108.37,91.69,95.38,98.09,
92.05,106.36,93.98,102.26,103.81,98.00,99.20,106.46,
109.58,113.86,103.72,105.94,114.61,111.08,106.89,
119.51,110.30,110.00,108.31,108.68,108.98,115.01,
113.07,114.89,109.79,105.70,114.20,113.53,113.97,
110.91,110.33,115.78,111.05,108.53,111.56,110.78,
109.71,112.18,112.05,109.46,103.84,112.23,118.56,
110.60,109.54,112.31,100.78,114.07,112.14,107.85,
111.65,105.94,108.63,109.89,107.14,108.76,110.11,
104.60,107.11,112.49,113.74,103.19,105.07,109.04,
110.45,105.02,108.27,109.17,110.37,110.92,107.53,
109.22,113.01,108.74,116.74,112.10,110.88,111.08,
110.22,111.23,112.94,99.04,113.51,107.26,110.76,
108.06,97.03,109.14,105.56,111.55,108.85,98.46,110.24,
112.22,108.57,105.95,106.30),

d =c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),

age=c(41,36,38,46,38,45,42,42,43,43,43,55,47,46,47,47,32,38,45,37,43,36,52,48,37,42,41,47,46,46,45,49,44,48,50,48,43,47,44,57,48,49,40,41,45,45,52,45,48,45,42,46,48,44,36,48,39,44,51,48,47,39,38,43,39,45,40,35,36,41,46,48,55,41,44,35,38,47,45,50,40,44,46,38,38,50,44,40,46,37,43,40,46,43,36,44,32,47,40,38,42,46,45,41,53,45,41,40,55,48,44,47,47,45,41,53,41,38,43,47,50,45,43,46,42,43,42,47,46,44,37,42,43,44,44,46,36,50,40,39,37,55,41,45,43,39,54,37,38,42,44,48,50,33,42,48,40,49,38,47,39,38,47,39,44,49,46,48,38,39,38,48,42,42,43,36,34,41,36,49,43,35,40,46,44,41,49,46,42,47,42,42,49,43,41,47,47,44,39,42,43,51,43,46,37,44,42,38,35,42,45,49,42,40,45,48,42,52,53,49,63,53,62,57,57,64,53,54,55,59,54,53,55,63,52,58,59,57,56,56,55,59,59,62,59,56,64,59,56,60,54,60,54,54,53,57,58,54,59,63,55,59,51,52,57,60,58,50,62,59,61,53,64,50,55,57,60,58,59,56,55,53,57,53,54,59,61,59,56,56,58,57,60,57,59,54,60,51,61,57,53,53,60,64,58,56,63),

male=c(1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,1,0,0,1,1,1,0,1,0,1,1,0,1,0,1,0,0,1,0,0,1,0,1,1,0,1,0,0,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,1,1,1,0,1,0,1,0,1,1,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,0,0,0,0,1,1,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,1,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,1,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,0,1,0,0,1,1,1,0))



list(beta=c(0,0,0,0), precy=c(1,1))


No comments:

Post a Comment