*data from Gregoriou, O, Vitoratos, N, Papadias, C, Konidaris, S, Gargaropoulos, A, Rizos, D. Pregnancy rates in gonadotrophin stimulated cycles with timed intercourse or intrauterine insemination for the treatment of male subfertility, Eur J Obstet Gynecol Reprod Biol 1996; 64: 213-216. #Model involving period effect only model { for( i in 1 : N1 ) { outcome1[i] ~ dbern(p1[i]) logit(p1[i]) <- intercept+pi*period1[i]+b[i] b[i] ~ dnorm(0, beta) } for( i in 1 : N2){ outcome2[i] ~ dbern(p2[i]) logit(p2[i]) <- intercept+pi*period2[i]+b[i] } sigma<- 1/sqrt(beta) intercept ~ dnorm(0,1.0E-3) pi ~ dnorm(0,1.0E-3) beta~ dgamma(1,1.0E-3) log.sigma<- log(sigma) } list(outcome1 =c(0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1) , period1 =c(0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0), outcome2 =c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 1, 1, 1, 1,1,1,1,1) , period2=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), N1 = 62, N2=50), list(intercept=-1,pi=1,beta=10,b=c(0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0 ,0 ,0, 0, 0, 0 ,0 ,0, 0, 0 ,0, 0, 0, 0, 0,0, 0, 0 ,0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0)) list(intercept=-4,pi=4,beta=15,b=c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0 ,0 ,0, 0, 0 ,0, 0, 0, 0, 0,0, 0, 0 ,0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,1)) ********************************************************************* ********************************************************************* #The model involving both treatment and period effect model { for( i in 1 : N1 ) { outcome1[i] ~ dbern(p1[i]) logit(p1[i]) <- intercept+tau*treatment1[i]+pi*period1[i]+b[i] b[i] ~ dnorm(0, beta) } for( i in 1 : N2){ outcome2[i] ~ dbern(p2[i]) logit(p2[i]) <- intercept+tau*treatment2[i]+pi*period2[i]+b[i] } sigma<- 1/sqrt(beta) intercept ~ dnorm(0,1.0E-3) tau ~ dnorm(0,1.0E-3) pi ~ dnorm(0,1.0E-3) beta~ dgamma(1,1.0E-3) log.sigma<- log(sigma) } list(outcome1 =c(0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1) , treatment1=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1) , period1 =c(0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0), outcome2 =c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 1, 1, 1, 1,1,1,1,1) , period2=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), treatment2=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0), N1 = 62, N2=50), list(intercept=-1,tau=-1,pi=1,beta=10,b=c(0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0 ,0 ,0, 0, 0, 0 ,0 ,0, 0, 0 ,0, 0, 0, 0, 0,0, 0, 0 ,0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0)) list(intercept=-4,tau=-4,pi=4,beta=15,b=c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0 ,0 ,0, 0, 0 ,0, 0, 0, 0, 0,0, 0, 0 ,0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,1)) ********************************************************************* ********************************************************************* #The null Model model { for( i in 1 : N1 ) { outcome1[i] ~ dbern(p1[i]) logit(p1[i]) <- intercept+b[i] b[i] ~ dnorm(0, beta) } for( i in 1 : N2){ outcome2[i] ~ dbern(p2[i]) logit(p2[i]) <- intercept+b[i] } sigma<- 1/sqrt(beta) intercept ~ dnorm(0,1.0E-3) beta ~ dgamma(1,1.0E-3) log.sigma<- log(sigma) } list(outcome1 =c(0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1) , outcome2 =c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 1, 1, 1, 1,1,1,1,1) , N1 = 62, N2=50), list(intercept=-1,beta=10,b=c(0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0 ,0 ,0, 0, 0, 0 ,0 ,0, 0, 0 ,0, 0, 0, 0, 0,0, 0, 0 ,0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0)) list(intercept=-4,beta=15,b=c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0 ,0 ,0, 0, 0 ,0, 0, 0, 0, 0,0, 0, 0 ,0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,1)) ***************************************************************************** ***************************************************************************** #The model involving treatment only model { for( i in 1 : N1 ) { outcome1[i] ~ dbern(p1[i]) logit(p1[i]) <- intercept+tau*treatment1[i]+b[i] b[i] ~ dnorm(0, beta) } for( i in 1 : N2){ outcome2[i] ~ dbern(p2[i]) logit(p2[i]) <- intercept+tau*treatment2[i]+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