# Longitudinal model over time # Emax time-course function # Fixed treatment effects for ET50 with treatment effects constrained to a single mean effect # Fixed treatment effects for Emax # Reference treatment effect for ET50 exchangeable across studies (Equation [12] in manuscript) model{ # Begin Model Code for(i in 1:NS){ # Run Through all NS trials mu.Emax[i] ~ dnorm(0,0.0001) mu.ET50[i] ~ dnorm(m.mu,tau.mu) # Exchangeable baseline effect for ET50 (Equation [12] in manuscript) delta.Emax[i,1] <- 0 delta.ET50[i,1] <- 0 for (k in 1:narm[i]){ for (m in 1:fups[i]) { # Run through all observations within a study y[i,k,m] ~ dnorm(theta[i,k,m], prec[i,k,m]) # Normal likelihood prec[i,k,m] <- pow(se[i,k,m], -2) theta[i,k,m] <- exp(l.E0[i,k]) + ((Emax[i,k] * time[i,m]) / (exp(l.ET50[i,k]) + time[i,m])) # Time-course function resdev[i,k,m] <- pow((y[i,k,m] - theta[i,k,m]),2) * prec[i,k,m] # residual deviance for normal likelihood dev[i,k,m] <- -2* (log(pow((prec[i,k,m]/(2*3.14159)),0.5) * exp(-0.5*(pow((y[i,k,m]-theta[i,k,m]),2)*prec[i,k,m])))) # deviance for normal likelihood } armdev[i,k] <- sum(dev[i,k,1:fups[i]]) resarmdev[i,k] <- sum(resdev[i,k,1:fups[i]]) # Relative effects for time-course parameters Emax[i,k] <- mu.Emax[i] + delta.Emax[i,k] l.ET50[i,k] <- mu.ET50[i] + delta.ET50[i,k] l.E0[i,k] ~ dnorm(0,0.0001) # priors for baseline nuisance parameter } studydev[i] <- sum(armdev[i, 1:narm[i]]) resstudydev[i] <- sum(resarmdev[i, 1:narm[i]]) # Consistency equations for(k in 2:narm[i]){ delta.Emax[i,k] <- d.Emax[treat[i,k]] - d.Emax[treat[i,1]] delta.ET50[i,k] <- d.ET50[treat[i,k]] - d.ET50[treat[i,1]] } } d.Emax[1] <- 0 d.ET50[1] <- 0 for (k in 2:NT){ d.Emax[k] ~ dnorm(0,0.001) # Priors on relative treatment effects d.ET50[k] <- m.ET50 # ET50 treatment effects constrained to a single mean treatment effect } m.ET50 ~ dnorm(0,0.001) # Prior for mean ET50 treatment effect m.mu ~ dnorm(0,0.001) # Prior for mean reference treatment ET50 # Between-study SD for reference treatment ET50 tau.mu <- pow(sd.mu, -2) sd.mu ~ dunif(0,5) totdev <- sum(studydev[]) totresdev <- sum(resstudydev[]) # Model ends }