-
Notifications
You must be signed in to change notification settings - Fork 0
/
Model.6.3.txt
54 lines (43 loc) · 1.05 KB
/
Model.6.3.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
49
50
51
52
53
model {
for (i in 1:32) {
# Likelihood:
r[i] ~ dbin(p[i], n[i])
# Logistic regression model:
logit(p[i]) <- mu[s[i]] + delta[s[i]] * equals(t[i], 2)
# Predicted likelihood
# for deaths:
r.mxd[i] ~ dbin(p.new[i], n[i])
# Mixed predictve
# p-value:
p.mxd[i] <- step(r.mxd[i] - r[i]) - 0.5 * equals(r.mxd[i], r[i])
# Predicted probability
# of death:
logit(p.new[i]) <- mu[s[i]] + delta.new * equals(t[i], 2)
}
for (j in 1:16) {
# Hierarchical random
# effects model:
delta[j] ~ dnorm(d, prec)
# Prior for baseline
# random effect, µ:
mu[j] ~ dnorm(0, 1.0e-6)
}
# Prior for Pop.
# treatment effect:
d ~ dnorm(0, 1.0e-6)
# Population OR:
OR <- exp(d)
# Prior for btw. studies
# sd:
tau ~ dnorm(0, 1.0e-6)T(0, )
# Variance:
tau.sq <- (tau * tau)
# Precision:
prec <- 1 / (tau.sq)
# Predicted average
# treatment effect:
delta.new ~ dnorm(d, prec)
# Mean random
# effect:
delta[19] <- exp(d)
}