Random effects SD depends on prior distributions (WINBUGS)

70 Views Asked by At

I am new to Winbugs and I am trying to code a random effects model for network-metaanalysis. I set a vague prior for standard deviation of the of the treatment effect "sd~dunif(0,5)" and I found out that sd's estimates eqaul ca. 2. When I increase or decrease this range the sd's estimates change proportionately. I would be grateful if someone could look at this code and maybe improve it.

The data structure is presented below: data_structure

#DATA
list(n=4, t=4, ref=1)
y[] se[] t1[] t2[]
0.8 0.09 1 2
0.73 0.12 1 3
1.03 0.34 3 4
0.4 0.2 1 4
END
  • n - number of studies
  • t - number of treatments
  • ref - selected reference treatment for metaanalysis
  • y - is the observed variable: treatment difference between t1 and t2
  • se - is the standard error of y
  • t1 - is the treatment in arm 1
  • t2 - is the treatment in arm 2

RANDOM EFFECTS MODEL

model{
for (i in 1:n){
    y[i]~dnorm(delta[i],prec[i])

    var[i]<-pow(se[i],2)
    prec[i]<-1/var[i]

    delta[i]~dnorm(md[i],taud[i])
        md[i]<-d[t2[i]]-d[t1[i]]

        taud[i]<- tau*2 
    }

    sd~dunif(0,5)
    tau<-1/pow(sd,2)

    for(k in 1:ref-1){
    d[k]~dnorm(0,0.0001)
    }

    d[ref]<-0

    for(k in ref+1:t){
    d[k]~dnorm(0,0.0001)
    }

}
0

There are 0 best solutions below