I have a RCT that was designed from a Bayesian perspective that I now want want to analyze. First with default vague prior which seems to work OK as the estimates correspond to 7/450 and 15/550
death_TC4 <- data.frame(N = c(450,550), y = c(7,15), grp2 = as.factor(c(0,1)))
f = bf(y | trials(N) ~ 0 + grp2)
# vague prior
m1 <- brm(
formula = f,
data = death_TC4,
family = binomial(link = "identity"),
chains = 4, warmup = 1000, iter = 5000, seed = 123,
refresh = 0
)
print(m1)
Now I want to include some prior information from another study about the efficacy of each drug
m2 <- brm(
formula = f,
data = death_TC4,
family = binomial(link = "identity"),
prior = c(prior(beta(35,880), class = b, coef = "grp20"),
prior(beta(29,870),class = b, coef = "grp21")),
chains = 4, warmup = 1000, iter = 5000, seed = 123,
refresh = 0
)
print(m2)
This also seems a reasonable result. Finally I want to include a lot of prior information from a meta-analysis (yes, i realize that my study is a drop in the bucket and doesn’t change anything from the meta-analysis but bear with me). The meta-analysis shows decreased deaths with drug coded as 0 (320/1599) compared to drug 1 (125/480). However when I run the code the results seem completely strange to me.
m3<- brm(
formula = bf(y | trials(N) ~ 0 + grp2),
data = death_TC4,
family = binomial(link = "identity"),
prior = c(prior(beta(320,1279), class = b, coef = "grp20"),
prior(beta(125,355),class = b, coef = "grp21")),
chains = 4, warmup = 1000, iter = 5000, seed = 123,
refresh = 0
)
print(m3)
Can someone explain to me what is going?