# 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) # Multivariate likelihood (compound symmetry covariance structure) to account for correlation between time points # Correlation coefficient (rho) estimated within model - deviance / residual deviance not calculated as saturated model is not uniquely defined 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]){ # Generates covariance matrix upper and lower triangles - compound symmetry covariance structure for (c in 1:(fups[i]-1)) { for (r in (c+1):fups[i]) { cov.mat[i,k,r,c] <- se[i,k,c]*se[i,k,r]*rho # Lower triangle cov.mat[i,k,c,r] <- se[i,k,c]*se[i,k,r]*rho # Upper triangle } } # Generates covariance matrix diagonals for (m in 1:fups[i]) { cov.mat[i,k,m,m] <- pow(se[i,k,m],2) } omega[i,k,1:fups[i], 1:fups[i]] <- inverse(cov.mat[i,k,1:fups[i],1:fups[i]]) # Inverse covariance matrix y[i,k,1:fups[i]] ~ dmnorm(theta[i,k,1:fups[i]], omega[i,k,1:fups[i],1:fups[i]]) # Multivariate normal likelihood for (m in 1:fups[i]) { # Run through all observations within a study 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 } # 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 } # 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) rho ~ dunif(-0.1,1) # Prior for correlation between time points - assumed to be positive # Model ends }