Friday, July 15, 2011

Chapter 10 Code for Advanced Bayesian Methods for Medical Test Accuracy


BUGS CODE 10.1

Model;
# Two Binary Tests
{
# Dirichlet distribution generated
  g00~dgamma(a00,2)
  g01~dgamma(a01,2)
  g10~dgamma(a10,2)
  g11~dgamma(a11,2)

sumall<-g00+g01+g10+g11+
h00+h01+h10+h11

  h00~dgamma(b00,2)
  h01~dgamma(b01,2)
  h10~dgamma(b10,2)
  h11~dgamma(b11,2)

# cell probabilities for diseased

theta00<-g00/sumall
theta01<-g01/sumall
theta10<-g10/sumall
theta11<-g11/sumall
# cell probabilities for non diseased

ph00<-h00/sumall
ph01<-h01/sumall
ph10<-h10/sumall
ph11<-h11/sumall





# truncated distributions

stheta<-theta00+theta01+theta10+theta11
sph<-ph00+ph01+ph10+ph11

# truncated thetas

th00<-theta00/stheta
th01<-theta01/stheta
th10<-theta10/stheta
th11<-theta11/stheta

# truncated phi's

p00<-ph00/sph
p01<-ph01/sph
p10<-ph10/sph
p11<-ph11/sph

# sensitivities
# a designates row
# b designates column
# tpf a
tpfa<-th10+th11
#tpf b
tpfb<-th01+th11
# believe the positive tpf
bptpf<-th01+th11+th10

# believe the negative tpf
bntpf<-th11
# false positives
#fpf a
fpfa<-p10+p11
# fpf b
fpfb<-p01+p11




# believe the positve false positive fraction
bpfpf<-p01+p11+p10
# believe the negative fpf
bnfpf<-p11

}
# CASS data set
#Comparing est and cph
# a is est
# b is cph
list( a00=26, a01=184,a10=30,a11=787,
      b00=152,b01=177,b10=47,b11=70)

# Gerber et al. data set
# a is CT
# b is MRI
list( a00=13, a01=1,a10=11,a11=37,
      b00=169,b01=1,b10=31,b11=39)

# Berger et al. study for breast cancer
# a is mammography
# b is ultrasound


list( a00=11, a01=48,a10=21,a11=101,
      b00=22,b01=40,b10=8,b11=39)

# initial values
list(g00=1,g01=1,g10=1,g11=1,
     h00=1,h01=1,h10=1,h11=1)





BUGS CODE 10.2

model;

# BUGS CODE 10.1
# Two Binary Tests with Two Readers
# Accurcy of Combined Tests
# BP or BN
# Dirichlet Distribution generated

{
g001~dgamma(a001,2)
g011~dgamma(a011,2)
g101~dgamma(a101,2)
g111~dgamma(a111,2)

g002~dgamma(a002,2)
g012~dgamma(a012,2)
g102~dgamma(a102,2)
g112~dgamma(a112,2)

h001~dgamma(b001,2)
h011~dgamma(b011,2)
h101~dgamma(b101,2)
h111~dgamma(b111,2)

h002~dgamma(b002,2)
h012~dgamma(b012,2)
h102~dgamma(b102,2)
h112~dgamma(b112,2)

sumall<-g001+g011+g101+g111+g002+g012+g102+g112+
             h001+h011+h101+h111+h002+h012+h102+h112

# cell probabilities for diseased

th001<-g001/sumall
th011<-g011/sumall
th101<-g101/sumall
th111<-g111/sumall

th002<-g002/sumall
th012<-g012/sumall
th102<-g102/sumall
th112<-g112/sumall


# cell probabilities for non diseased

ph001<-h001/sumall
ph011<-h011/sumall
ph101<-h101/sumall
ph111<-h111/sumall

ph002<-h002/sumall
ph012<-h012/sumall
ph102<-h102/sumall
ph112<-h112/sumall

# truncated cell probabilities
# reader 1 diseased
sth1<-th001+th011+th101+th111

theta001<- th001/sth1
theta011<- th011/sth1
theta101<- th101/sth1
theta111<- th111/sth1

# reader 2 diseaded

 sth2<-th002+th012+th102+th112

theta002<- th002/sth2
theta012<- th012/sth2
theta102<- th102/sth2
theta112<- th112/sth2

# reader 1 non diseased

 sph1<- ph001+ph011+ph101+ph111

 phi001<-ph001/sph1
 phi011<-ph011/sph1
 phi101<-ph101/sph1
 phi111<-ph111/sph1

 # reader 2 non diseased

 sph2<- ph002+ph012+ph102+ph112

 phi002<-ph002/sph2
 phi012<-ph012/sph2
 phi102<-ph102/sph2
 phi112<-ph112/sph2

 # accuracy parameters

 # TPF test 1 reader 1

tpft1r1<- theta101+theta111

# TPF test 2 reader 1

tpft2r1<- theta011+theta111

# TPF test 1 reader 2

tpft1r2<- theta102+theta112

# TPF test 2 reader 2

tpft2r2<- theta012+theta112

# FPF test 1 reader 1

fpft1r1<-phi101+phi111

#FPF test 1 reader 2

fpft1r2<- phi102+phi112

# FPF test 2 reader 1

fpft2r1<-phi011+phi111

# FPF  test 2 reader 2

fpft2r2<- phi012+phi112

# accuracy for combined test
# accuracy parameters for BP

 # TPF reader 1 BP

tpfbpr1<-theta101+theta111+theta011

# FPF reader 1 BP

fpfbpr1<-phi101+phi111+phi011

 # TPF reader 2 BP

 tpfbpr2<-theta102+theta112+theta012

# FPF reader 2 BP

 fpfbpr2<- phi102+phi112+phi012


# accuracy parameters for BN

# TPF reader 1 BN

tpfbnr1<-theta111

# TPF reader 2 BN

tpfbnr2<- theta112

# FPF reader 1 BN

fpfbnr1<- phi111

# FPF reader 2 BN

fpfbnr2<- phi112

}

# two readers CT and MRI
list(a001=13, a011=1,a101=11,a111=37,
a002=10 , a012=4,a102=14,a112=34,

b001=169 , b011=1,b101=31,b111=39,b002=167, b012=3,b102=33,b112=36)

# two readers CT and MRI second version

list(a001=13 , a011=1,a101=11,a111=37,
a002=7, a012=7,a102=17,a112=31,

b001=169 , b011=1,b101=31,b111=39,
b002=151 , b012=19,b102=49,b112=21)



BUGS CODE 10.3

model;
{

# two binary tests verification bias

# accuracy of combined tests
g00~dgamma(m00,2)
g01~dgamma(m01,2)
g10~dgamma(m10,2)
g11~dgamma(m11,2)

h<-g00+g01+g10+g11

th00<-g00/h
th01<-g01/h
th10<-g10/h
th11<-g11/h

ph00~dbeta(s00,r00)
ph01~dbeta(s01,r01)
ph10~dbeta(s10,r10)
ph11~dbeta(s11,r11)

s1.<-s11+s10
r1.<-r11+r10
s.1<-s01+s11
r.1<- r01+r11

r0.<- r00+r01
s0.<-s00+s01
s.0<-s00+s10
r.0<-r00+r10

ph1.~dbeta(s1.,r1.)
ph.1~dbeta(s.1,r.1)
ph0.~dbeta(s0.,r0.)
ph.0~dbeta(s.0,r.0)


th1.<-th11+th10
th.1<-th01+th11
th0.<-th01+th00
th.0<-th00+th10
# accuracy for test 1
tpf1<-ph1.*th1./pd1
fpf1<-(1-ph1.)*th1./(1-pd1)
# p[D-1]
pd1<-ph1.*th1.+ph0.*th0.
# accuracy for test 2

tpf2<-ph.1*th.1/pd2
fpf2<-(1-ph.1)*th.1/(1-pd2)
pd2<-ph.1*th.1+ph.0*th.0

# accuracy combined tests
# believe the positive, BP

tpfbp<-(ph11*th11+ph01*th01+ph10*th10)/pd
# P[d=1]
pd<- ph11*th11+ph10*th10+ph01*th01+ph00*th00
fpfbp<-((1-ph11)*th11+(1-ph10)*th10+(1-ph01)*th01)/(1-pd)

# believe the negative , BN
tpfbn<-ph11*th11/pd
fpfbn<- (1-ph11)*th11/(1-pd)

}
# Alzheimers two readers improper prior
list(s00=5,r00=150,s01=85,r01=95,s10=131,r10=25,s11=191,r11=10,
m00=211,m01=60,m10=280,m11=855)
# initiate initial values using specification tool




BUGS CODE 10.4
Model;
{
# Scores for tests 1 and 2 diseased
for(i in 1:5){for(j in 1:5){ g[i,j]~dgamma(y[i,j],2)}}
sg<-sum(g[,])
# Scores for tests 1 and 2 non diseased
for(i in 1:5){for(j in 1:5){ h[i,j]~dgamma(z[i,j],2)}}
sh<-sum(h[,])
# cell probabilities for diseased
for( i in 1:5){for( j in 1:5){ theta[i,j]<-g[i,j]/sg }}
# cell probabilities for non diseased
for( i in 1:5){for( j in 1:5){ phi[i,j]<-h[i,j]/sh }}
# cell probabilities have a Dirichlet distribution
th1.<-sum(theta[1,])
th2.<-sum(theta[2,])
th3.<-sum(theta[3,])
th4.<-sum(theta[4,])
th5.<-sum(theta[5,])
th.1<-sum(theta[,1])
th.2<-sum(theta[,2])
th.3<-sum(theta[,3])
th.4<-sum(theta[,4])
th.5<-sum(theta[,5])
ph1.<- sum(phi[1,])
ph2.<-sum(phi[2,])
ph3.<- sum(phi[3,])
ph4.<- sum(phi[4,])
ph5.<- sum(phi[5,])
ph.1<- sum(phi[,1])
ph.2<- sum(phi[,2])
ph.3<-sum(phi[,3])
ph.4<-sum(phi[,4])
ph.5<-sum(phi[,5])


# ROC area test 1
area1<- area11+area12/2

area11<-th2.*ph1.+th3.*(ph1.+ph2.)+th4.*(ph1.+ph2.+ph3.)+
th5.*(ph1.+ph2.+ph3.+ph4.)

area12<-th1.*ph1.+th2.*ph2.+th3.*ph3.+th4.*ph4.+th5.*ph5.

# ROC area for test 2
area2<- area21+area22/2

area21<-th.2*ph.1+th.3*(ph.1+ph.2)+th.4*(ph.1+ph.2+ph.3)+
th.5*(ph.1+ph.2+ph.3+ph.4)

area22<-th.1*ph.1+th.2*ph.2+th.3*ph.3+th.4*ph.4+th.5*ph.5
}

# example of mri (test 2)and ct (test 1) for lung cancer
# assumes uniform prior
list(y=structure(.Data=c(16,11,7,3,2,
                                      10,22,11,4,3,
                                      6,7,33,7,4,
                                      3,1,7,48,3,
                                      1,2,3,6,66),.Dim = c(5,5)),
    z=structure(.Data=c(93,63,42,9,6,
                                   59,82,11,9,5,
                                   39,31,66,32,19,
                                   17,3,22,36,13,
                                    6,2,4,12,18),.Dim = c(5,5))))


# Two MRI versions for prostate cancer
# Assumes a uniform prior
list(y=structure(.Data=c(4,8,7,4,1,
                                      2,6,9,8,7,
                                      3,3,5,12,8,
                                      1,2,2,9,14,
                                      1,1,2,5,24),.Dim = c(5,5)),
    z=structure(.Data=c(104,10,4,3,4,
                                     32,63,12,7,6,
                                      26,23,32,14,10,
                                      12,12,21,31,16,
                                     14,16,29,22,14),.Dim = c(5,5))))





BUGS CODE 10.5

model:

# logistic regression

{

for( i in 1:N){d[i]~dbern(theta[i])}

for( i in 1:N){logit(theta[i])<- b[1]+b[2]*T1[i]+b[3]*T2[i]}

# prior distributions

for( i in 1:3){ b[i]~dnorm(0.000,.0001)}

# area under the curve

for( i in 1 : N){ p[i]~dnorm(mu[i], precy[d[i]+1])

mu[i]<-beta[1]+beta[2]*d[i]}

# prior distributions

for( i in 1:2){beta[i]~dnorm(0.000,.0001)
precy[i]~dgamma(0.0001,.0001)

vary[i]<-1/precy[i]}

la1y<-beta[2]/sqrt(vary[1])
la2y<-vary[2]/vary[1]
auc<-phi(la1y/sq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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),

p=c(.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.17,.17,.17,.17,.17,.17,.23,.23,.29,.13,.13,.13,.13,.13,.13,.13,.13,.13,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.29,.29,.29,.37,.37,.18,.18,.18,.18,.18,.23,.23,.23,.23,.23,.23,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.37,.37,.37,.37,.37,.37,.45,.45,.45,.23,.23,.38,.38,.38,.38,.38,.38,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.54,.54,.38,.46,.46,.55,.55,.55,.55,.55,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.23,.23,.23,.23,.23,.23,.23,.23,.29,.29,.29,.29,.29,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.13,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.29,.29,.29,.29,.29,.29,.29,.29,.37,.37,.37,.37,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.18,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.30,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.45,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.23,.30,.30,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.38,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.46,.54,.54,.54,.54,.54,.54,.54,.54,.54,.54,.54,.54,.30,.30,.30,.30,.30,.38,.46,.46,.46,.55,.55,.55,.55,.55,.55,.55,.55,.55,.55,.55,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63,.63))

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

# prostate cancer study
list(N=644, T1=c(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,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,5,5,5,5,5,5,5,5,5,5,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,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,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,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),



p=c(.06,.06,.06,.15,.15,.15,.15,.15,.15,.15,.33,.33,.33,.33,.33,.33,.59,.59,.59,.80,.04,.10,.10,.10,.10,.10,.25,.25,.25,.25,.25,.25,.25,.25,.48,.48,.48,.48,.48,.48,.48,.72,.72,.72,.72,.72,.72,.03,.03,.07,.07,.17,.17,.17,.17,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.63,.63,.63,.63,.63,.63,.63,.05,.12,.28,.28,.28,.28,.28,.28,.28,.28,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.08,.20,.20,.20,.20,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.06,.15,.15,.15,.15,.15,.15,.15,.15,.15,.33,.33,.33,.59,.59,.80,.80,.80,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.04,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.10,.25,.25,.25,.25,.25,.25,.25,.25,.25,.25,.25,.48,.48,.48,.48,.48,.48,.72,.72,.72,.72,.72,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.07,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.17,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.37,.63,.63,.63,.63,.63,.63,.63,.63,.63,.02,.02,.02,.02,.02,.02,.02,.02,.02,.02,.02,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.12,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.28,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.52,.01,.01,.01,.01,.01,.01,.01,.01,.01,.01,.01,.01,.01,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.03,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.08,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.20,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41,.41))

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



No comments:

Post a Comment