-
Notifications
You must be signed in to change notification settings - Fork 0
/
Model.5.2.2.txt
49 lines (42 loc) · 998 Bytes
/
Model.5.2.2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
model {
# Binomial Likelihood for the
# i'th study:
for (i in 1:Nstud) {
rA[i] ~ dbin(pA[i], nA[i])
rB[i] ~ dbin(pB[i], nB[i])
# Logistic regression for
# the i'th study:
logit(pA[i]) <- mu[i]
logit(pB[i]) <- mu[i] + delta[i] + beta * (lat[i] - mean(lat[]))
# Statistical model,
# linking the
# parameters to likelihood:
delta[i] ~ dnorm(d, prec)
}
# Prior on µ, the estimate
# log(odds) of an event for
# i'th study:
for (i in 1:Nstud) {
mu[i] ~ dnorm(0.0, 1.0e-5)
}
# Prior on intercept (d),
# the mean pooled treatment
# effect:
d ~ dnorm(0.0, 1.0e-6)
# Uncentering d:
d.uncent <- d - beta * mean(lat[])
# Data transformation for d:
OR <- exp(d)
# Prior on tau, sd for
# between studies:
tau ~ dunif(0, 10)
# tau.sq, between-study
# variance:
tau.sq <- tau * tau
# Precision as a
# fucntion of tau:
prec <- 1 / (tau.sq)
# Prior on Beta, the
# coefficient:
beta ~ dnorm(0.0, 1.0e-6)
}