gertvv / gemtc

GeMTC R package: model generation for network meta-analysis
GNU General Public License v3.0
43 stars 25 forks source link

using gemtc for absolute risk difference #70

Open marinheira opened 2 years ago

marinheira commented 2 years ago

Thank you for creating such amazing package! I have one question. There is no information for using absolute risk difference (ARD) in documentation of "gemtc". However, there is a recomendation in NICE TSD to use binom/logit model to compute effects for ARD. I figured out the gemtc not provide such model for ARD and i tryed to create it manually from other models in package. But my attempts failed. Can you tell me how i can use gemtc for ARD? With best regards!

marinheira commented 2 years ago

I tryed to work with this model template: model { for (i in 1:ns) {

Likelihood for each arm

for (k in 1:na[i]) { %armLikelihood% }

Study-level relative effects

w[i, 1] <- 0 delta[i, 1] <- 0

parameterize multi-arm trials using a trick

to avoid using the multi-variate normal

for (k in 2:na[i]) { delta[i, k] ~ dnorm(md[i, k], taud[i, k]) md[i, k] <- d[t[i, 1], t[i, k]] + sw[i, k] taud[i, k] <- tau.d 2 (k- 1) / k w[i, k] <- delta[i, k]- d[t[i, 1], t[i, k]] sw[i, k] <- sum(w[i, 1:k-1]) / (k- 1) } }

Relative effect matrix

%relativeEffectMatrix%

Study baseline priors for (i in 1:ns) {

mu[i] ~ dnorm(0, %priorPrecision%) }

Variance prior

sd.d ~ dunif(0, %upper%) tau.d <- pow(sd.d,-2)

Effect parameter priors

%parameters% }

and this likehood: logit(p[i, k]) <- mu[i] + delta[i, k] r[i, k] ~ dbin(p[i, k], n[i, k])

rhat[i, k] <- p[i, k] n[i, k] dev[i, k] <- 2 (r[i, k] (log(r[i, k]) - log(rhat[i, k])) + (n[i, k]-r[i, k]) (log(n[i, k] - r[i, k]) - log(n[i, k] - rhat[i, k])))