Chapter 9:  Linear regression
ANOVA of the diasorin data

Example 9.5.1.  
# Model data as log normal
model{ # First part is for analysis on log scale
 for(i in 1:n[1]){low[i]~dlnorm(mu[1],tau)}
 for(i in 1:n[2]){normal[i]~dlnorm(mu[2],tau)}
 for(i in 1:n[3]){high[i]~dlnorm(mu[3],tau)}
# Prior specification
 mu[1]~dnorm(4.87,347.12)
 mu[2]~dnorm(5.39,357.42)
 mu[3]~dnorm(6.40,166.67)
 tau~dgamma(0.001,0.001)
# Test for ordering of medians
 P <- step(mu[3]-mu[2])*step(mu[2]-mu[1])
# Predictive densities for three future (log-scale) observations
 lowf.ls~dnorm(mu[1],tau)
 normalf.ls~dnorm(mu[2],tau)
 highf.ls ~ dnorm(mu[3],tau)
# Additional inferential objects
 diff21 <- mu[2]-mu[1]
 diff31 <- mu[3]-mu[1]
 diff32 <- mu[3]-mu[2]
 prob21 <- step(diff21)
 prob31 <- step(diff31)
 prob32 <- step(diff32)
# The following part is for analysis on original data scale
 med[1] <- exp(mu[1])
 med[2] <- exp(mu[2])
 med[3] <- exp(mu[3])
 relmed21 <- med[2]/med[1]
 relmed31 <- med[3]/med[1]
 relmed32 <- med[3]/med[2]
# Simulate predictive densities on untransformed scale
 lowf <- exp(lowf.ls)
 normalf <- exp(normalf.ls)
 highf <- exp(highf.ls)
} # List of inputs follows
list(n=c(19,15,50),
low=c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,
            233,101,25,70,357),
normal=c(370,267,99,157,75,1281,48,298,268,62,804,
                 430,171,694,404),
high=c(75,52,1378,555,331,231,472,263,120,46,650,349,251,
             492,759,96,627,171,1584,69,368,509,486,354,351,
             839,88,162,1041,383,234,1130,503,244,606,457,460,
             283,767,576,628,239,583,428,452,723,201,406,422,243))
# Initial values
list(mu=c(4.87,5.39,6.4),tau=1,lowf.ls=100,normalf.ls=200,highf.ls=300)

	 node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	P	1.0	0.0	4.472E-13	1.0	1.0	1.0	10001	50000
	diff21	0.5351	0.07338	3.081E-4	0.3916	0.5348	0.6792	10001	50000
	diff31	1.396	0.08573	3.897E-4	1.227	1.395	1.564	10001	50000
	diff32	0.8605	0.08612	4.181E-4	0.692	0.8601	1.031	10001	50000
	highf	807.4	973.6	4.649	86.28	518.8	3290.0	10001	50000
	highf.ls	6.257	0.9278	0.004442	4.458	6.252	8.099	10001	50000
	lowf	198.7	238.2	1.054	20.78	128.6	801.0	10001	50000
	lowf.ls	4.86	0.927	0.003946	3.034	4.857	6.686	10001	50000
	med[1]	129.2	6.71	0.02867	116.5	129.0	142.9	10001	50000
	med[2]	220.6	11.4	0.05442	199.1	220.3	243.8	10001	50000
	med[3]	522.0	35.93	0.1681	455.5	520.5	596.6	10001	50000
	mu[1]	4.86	0.05191	2.219E-4	4.758	4.86	4.962	10001	50000
	mu[2]	5.395	0.05165	2.466E-4	5.294	5.395	5.496	10001	50000
	mu[3]	6.255	0.06867	3.202E-4	6.121	6.255	6.391	10001	50000
	normalf	337.5	398.8	1.721	34.77	220.5	1331.0	10001	50000
	normalf.ls	5.394	0.9257	0.00416	3.549	5.396	7.194	10001	50000
	prob21	1.0	0.0	4.472E-13	1.0	1.0	1.0	10001	50000
	prob31	1.0	0.0	4.472E-13	1.0	1.0	1.0	10001	50000
	prob32	1.0	0.0	4.472E-13	1.0	1.0	1.0	10001	50000
	relmed21	1.712	0.1258	5.294E-4	1.479	1.707	1.972	10001	50000
	relmed31	4.052	0.3482	0.001596	3.412	4.036	4.778	10001	50000
	relmed32	2.373	0.2049	9.978E-4	1.998	2.363	2.804	10001	50000
	tau	1.196	0.1914	9.196E-4	0.8543	1.185	1.602	10001	50000

Check for normality using R.

0. ANOVA:  Diasorin data with informative priors on mu's, diffuse priors on tau's.  
  Compare equal variance and unequal variance models using DIC.  Group 1 is low; 
  group 2 is normal; group 3 is high bone turnover

EQUAL VARIANCE MODEL
 model
 {
 for(i in 1:n1){
   loglow[i] <- log(low[i])
   loglow[i] ~ dnorm(mu1, tau)
   }
 for(i in 1:n2){
   lognormal[i] <- log(normal[i])
   lognormal[i] ~ dnorm(mu2, tau)
   }
  for(i in 1:n3){
   loghigh[i] <- log(high[i])
   loghigh[i] ~ dnorm(mu3, tau)
   }
 mu1 ~ dnorm(4.87, 347.12)
 mu2 ~ dnorm(5.39, 357.42)
 mu3 ~ dnorm(6.40, 166.67)
 tau ~ dgamma(0.001,0.001)
 }
 list(n1=19,n2=15, n3=50,
 low = c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,233,101,25,70,357),
 normal = c(370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404),
 high = c(75,52,1378,555,331,231,472,263,120,46,650,349,251,492,759, 96, 
 627,171,1584,69,368,509,486,354,351,839,88,162,1041,383,234,1130,503,244,606,
 457,460,283,767,576,628,239,583,428,452,723,201,406,422,243))
 list(mu1=4.87, mu2=5.39, mu3=6.4, tau=1)

UNEQUAL VARIANCE MODEL
 model
 {
 for(i in 1:n1){
   loglow[i] <- log(low[i])
   loglow[i] ~ dnorm(mu1, tau1)
   }
 for(i in 1:n2){
   lognormal[i] <- log(normal[i])
   lognormal[i] ~ dnorm(mu2, tau2)
   }
  for(i in 1:n3){
   loghigh[i] <- log(high[i])
   loghigh[i] ~ dnorm(mu3, tau3)
   }
 mu1 ~ dnorm(4.87, 347.12)
 mu2 ~ dnorm(5.39, 357.42)
 mu3 ~ dnorm(6.40, 166.67)
 tau1 ~ dgamma(0.001,0.001)
 tau2 ~ dgamma(0.001,0.001)
 tau3 ~ dgamma(0.001,0.001)
 r1 <-(1/sqrt(tau1))/(1/sqrt(tau2))   # For Exercise 9.15
 r2 <-(1/sqrt(tau1))/(1/sqrt(tau3))
 r3 <-(1/sqrt(tau2))/(1/sqrt(tau3))
 }
 list(n1=19,n2=15, n3=50,
 low = c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,233,101,25,70,357),
 normal = c(370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404),
 high = c(75,52,1378,555,331,231,472,263,120,46,650,349,251,492,759, 96, 
 627,171,1584,69,368,509,486,354,351,839,88,162,1041,383,234,1130,503,244,606,
 457,460,283,767,576,628,239,583,428,452,723,201,406,422,243))
 list(mu1=4.87, mu2=5.39, mu3=6.4, tau1=1,tau2=1,tau3=1)

Results

EQUAL VARIANCE:  DIC=225
	 node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	mu1	4.86	0.05204	1.628E-4	4.758	4.859	4.962	5001	100000
	mu2	5.395	0.05158	1.747E-4	5.293	5.395	5.495	5001	100000
	mu3	6.255	0.06849	2.2E-4	6.123	6.255	6.39	5001	100000
	tau	1.196	0.1906	5.911E-4	0.8548	1.185	1.598	5001	100000
	Dbar = post.mean of -2logL; Dhat = -2LogL at post.mean of stochastic nodes
					Dbar		Dhat		pD			DIC	
loghigh		131.940	131.155		0.785		132.724	
loglow		51.471		51.170		0.301		51.772	
lognormal	40.972		40.734		0.238		41.210	
total			224.382	  223.058	1.324		225.707	

UNEQUAL VARIANCE:  DIC=229
	 node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	mu1	4.86	0.05207	1.619E-4	4.759	4.86	4.962	5001	100000
	mu2	5.394	0.05157	1.629E-4	5.293	5.395	5.495	5001	100000
	mu3	6.252	0.06994	2.298E-4	6.117	6.252	6.391	5001	100000
	tau1	1.153	0.374	0.001162	0.5411	1.111	1.994	5001	100000
	tau2	1.129	0.4116	0.001314	0.4743	1.078	2.067	5001	100000
	tau3	1.242	0.2623	8.691E-4	0.7868	1.223	1.809	5001	100000
Dbar = post.mean of -2logL; Dhat = -2LogL at post.mean of stochastic nodes
				Dbar		Dhat			pD		DIC	
loghigh		132.144	130.963	1.181	133.324	
loglow		52.230		51.162	1.068	53.297	
lognormal	41.771		40.711	1.060	42.831	
total			226.144	222.836	3.309	229.453

1a. ANOVA:  Diasorin data with informative priors, equal variance.  Group 1 is low; group 2 is normal; group 3 is high bone turnover

 model
 {
 for(i in 1:n1){
   loglow[i] <- log(low[i])
   loglow[i] ~ dnorm(mu1, tau)
   }
 for(i in 1:n2){
   lognormal[i] <- log(normal[i])
   lognormal[i] ~ dnorm(mu2, tau)
   }
  for(i in 1:n3){
   loghigh[i] <- log(high[i])
   loghigh[i] ~ dnorm(mu3, tau)
   }
 mu1 ~ dnorm(4.87, 347.12)
 mu2 ~ dnorm(5.39, 357.42)
 mu3 ~ dnorm(6.40, 166.67)
 tau ~ dgamma(0.001,0.001)
 loglowf ~ dnorm(mu1, tau)
 lognormalf ~ dnorm(mu2, tau)
 loghighf ~ dnorm(mu3, tau)
 diff21 <- mu2-mu1
 diff31 <- mu3-mu1
 diff32 <- mu3-mu2
 prob21 <- step(diff21)
 prob31 <- step(diff31)
 prob32 <- step(diff32)
 med1 <- exp(mu1)
 med2 <- exp(mu2)
 med3 <- exp(mu3)
 relmed21 <- med2/med1
 relmed31 <- med3/med1
 relmed32 <- med3/med2
 MAD <- (abs(diff21)+abs(diff31)+abs(diff32))/3
 prob <- step(MAD-0.75)
 }
 list(n1=19,n2=15, n3=50,
 low = c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,233,101,25,70,357),
 normal = c(370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404),
 high = c(75,52,1378,555,331,231,472,263,120,46,650,349,251,492,759, 96, 
 627,171,1584,69,368,509,486,354,351,839,88,162,1041,383,234,1130,503,244,606,
 457,460,283,767,576,628,239,583,428,452,723,201,406,422,243))
 list(mu1=4.87, mu2=5.39, mu3=6.4, tau=1, loglowf=50, lognormalf=50, loghighf=50)
Results

node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	MAD	0.9305	0.05726	1.816E-4	0.8185	0.9303	1.043	5001	100000
	diff21	0.535	0.07334	2.119E-4	0.3916	0.5348	0.6789	5001	100000
	diff31	1.396	0.08589	2.724E-4	1.228	1.395	1.564	5001	100000
	diff32	0.8607	0.08602	2.885E-4	0.6922	0.8603	1.031	5001	100000
	loghighf	6.257	0.9285	0.002922	4.444	6.254	8.098	5001	100000
	loglowf	4.857	0.9289	0.003001	3.028	4.857	6.681	5001	100000
	lognormalf	5.395	0.9251	0.003004	3.563	5.396	7.202	5001	100000
	med1	129.2	6.716	0.0195	116.5	129.0	142.8	5001	100000
	med2	220.5	11.36	0.03515	199.1	220.2	243.7	5001	100000
	med3	522.0	36.03	0.1259	455.5	520.5	596.8	5001	100000
	mu1	4.86	0.05196	1.51E-4	4.758	4.86	4.961	5001	100000
	mu2	5.395	0.05145	1.589E-4	5.294	5.395	5.496	5001	100000
	mu3	6.255	0.06886	2.403E-4	6.121	6.255	6.392	5001	100000
	prob	0.9993	0.02645	7.912E-5	1.0	1.0	1.0	5001	100000
	prob21	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob31	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob32	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	relmed21	1.712	0.1258	3.641E-4	1.479	1.707	1.972	5001	100000
	relmed31	4.053	0.3489	0.001104	3.413	4.037	4.779	5001	100000
	relmed32	2.373	0.2047	6.877E-4	1.998	2.364	2.803	5001	100000
	tau	1.196	0.191	6.526E-4	0.8538	1.185	1.6	5001	100000

1b. ANOVA using the lognormal distribution.  Same model as 1a.  Diasorin data with 
   informative priors, equal variance.  
   Group 1 is low; group 2 is normal; group 3 is high bone turnover

 model
 {
 for(i in 1:n1){low[i] ~ dlnorm(mu1, tau)}
 for(i in 1:n2){normal[i] ~ dlnorm(mu2, tau)}
 for(i in 1:n3){high[i] ~ dlnorm(mu3, tau)}
 mu1 ~ dnorm(4.87, 347.12)
 mu2 ~ dnorm(5.39, 357.42)
 mu3 ~ dnorm(6.40, 166.67)
 tau ~ dgamma(0.001,0.001)
 lowf ~ dlnorm(mu1, tau)
 normalf ~ dlnorm(mu2, tau)
 highf ~ dlnorm(mu3, tau)
 P <- step(mu3-mu2)*step(mu2-mu1)*step(mu3-mu1) 
 diff21 <- mu2-mu1
 diff31 <- mu3-mu1
 diff32 <- mu3-mu2
 prob21 <- step(diff21)
 prob31 <- step(diff31)
 prob32 <- step(diff32)
 med1 <- exp(mu1)
 med2 <- exp(mu2)
 med3 <- exp(mu3)
 relmed21 <- med2/med1
 relmed31 <- med3/med1
 relmed32 <- med3/med2
 MAD <- (abs(diff21)+abs(diff31)+abs(diff32))/3
 prob <- step(MAD-0.75)
 for(i in 1:11){
   aL[i] <- piL*sqrt(tau/(2*3.14159))*(1/x[i])*exp(-(tau/2)*(log(x[i])-mu1)*(log(x[i]) - mu1))
   bL[i] <-  piN*sqrt(tau/(2*3.14159))*(1/x[i])*exp(-(tau/2)*(log(x[i])-mu2)*(log(x[i])-mu2))
   cL[i] <-  piH*sqrt(tau/(2*3.14159))*(1/x[i])*exp(-(tau/2)*(log(x[i])-mu3)*(log(x[i])-mu3))
   pL[i] <- aL[i]/(aL[i] + bL[i] + cL[i])
   pN[i] <- bL[i]/(aL[i] + bL[i] + cL[i]) 
   pH[i] <- cL[i]/(aL[i] + bL[i] + cL[i]) 
 }
}
 list(n1=19,n2=15, n3=50, piL=0.40, piN=0.20, piH=0.40,   
        x=c(50,150,250,350,450,550,650,750,850,950,1050),
 low = c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,233,101,25,70,357),
 normal = c(370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404),
 high = c(75,52,1378,555,331,231,472,263,120,46,650,349,251,492,759, 96, 
 627,171,1584,69,368,509,486,354,351,839,88,162,1041,383,234,1130,503,244,606,
 457,460,283,767,576,628,239,583,428,452,723,201,406,422,243))
 list(mu1=4.87, mu2=5.39, mu3=6.4, tau=1, lowf=50, normalf=50, highf=50)

Results

Same Results as 1a

	 node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	MAD	0.9305	0.05726	1.816E-4	0.8185	0.9303	1.043	5001	100000
	diff21	0.535	0.07334	2.119E-4	0.3916	0.5348	0.6789	5001	100000
	diff31	1.396	0.08589	2.724E-4	1.228	1.395	1.564	5001	100000
	diff32	0.8607	0.08602	2.885E-4	0.6922	0.8603	1.031	5001	100000
	highf	807.2	990.3	3.105	85.12	520.3	3288.0	5001	100000
	lowf	198.6	243.4	0.8085	20.66	128.6	797.0	5001	100000
	med1	129.2	6.716	0.0195	116.5	129.0	142.8	5001	100000
	med2	220.5	11.36	0.03515	199.1	220.2	243.7	5001	100000
	med3	522.0	36.03	0.1259	455.5	520.5	596.8	5001	100000
	mu1	4.86	0.05196	1.51E-4	4.758	4.86	4.961	5001	100000
	mu2	5.395	0.05145	1.589E-4	5.294	5.395	5.496	5001	100000
	mu3	6.255	0.06886	2.403E-4	6.121	6.255	6.392	5001	100000
	normalf	337.5	394.0	1.19	35.27	220.6	1343.0	5001	100000
	P	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob	0.9993	0.02645	7.912E-5	1.0	1.0	1.0	5001	100000
	prob21	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob31	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob32	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	relmed21	1.712	0.1258	3.641E-4	1.479	1.707	1.972	5001	100000
	relmed31	4.053	0.3489	0.001104	3.413	4.037	4.779	5001	100000
	relmed32	2.373	0.2047	6.877E-4	1.998	2.364	2.803	5001	100000

		Probs
	node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	pH[1]	0.05342	0.02018	5.926E-5	0.02121	0.05096	0.09934	5001	100000
	pH[2]	0.2168	0.02545	6.923E-5	0.1654	0.2173	0.2649	5001	100000
	pH[3]	0.3646	0.01491	4.518E-5	0.3336	0.3652	0.3922	5001	100000
	pH[4]	0.4784	0.01842	6.851E-5	0.4454	0.4774	0.5174	5001	100000
	pH[5]	0.5636	0.02738	9.71E-5	0.5138	0.5624	0.6206	5001	100000
	pH[6]	0.6278	0.0339	1.161E-4	0.5647	0.6267	0.6968	5001	100000
	pH[7]	0.6772	0.03793	1.271E-4	0.6051	0.6766	0.7528	5001	100000
	pH[8]	0.7159	0.0402	1.327E-4	0.6379	0.7159	0.7946	5001	100000
	pH[9]	0.7469	0.04131	1.349E-4	0.6652	0.7473	0.8264	5001	100000
	pH[10]	0.7722	0.04167	1.35E-4	0.6885	0.7731	0.8511	5001	100000
	pH[11]	0.7932	0.04156	1.338E-4	0.7086	0.7945	0.8706	5001	100000
	pL[1]	0.7688	0.03674	1.168E-4	0.696	0.7694	0.839	5001	100000
	pL[2]	0.5349	0.01935	5.331E-5	0.4988	0.5343	0.5744	5001	100000
	pL[3]	0.3866	0.01379	4.763E-5	0.3576	0.3872	0.4119	5001	100000
	pL[4]	0.2903	0.02216	7.855E-5	0.2438	0.2915	0.3301	5001	100000
	pL[5]	0.226	0.02745	9.517E-5	0.1702	0.2268	0.2771	5001	100000
	pL[6]	0.1813	0.02967	1.013E-4	0.1232	0.1815	0.2385	5001	100000
	pL[7]	0.1491	0.0301	1.017E-4	0.09214	0.1486	0.209	5001	100000
	pL[8]	0.1252	0.02959	9.928E-5	0.07085	0.1242	0.1856	5001	100000
	pL[9]	0.107	0.02861	9.546E-5	0.05588	0.1054	0.1666	5001	100000
	pL[10]	0.09267	0.02742	9.11E-5	0.04498	0.09078	0.151	5001	100000
	pL[11]	0.08126	0.02616	8.661E-5	0.03689	0.07906	0.1379	5001	100000
	pN[1]	0.1778	0.02134	7.051E-5	0.1336	0.1787	0.2166	5001	100000
	pN[2]	0.2482	0.008122	2.313E-5	0.233	0.248	0.2649	5001	100000
	pN[3]	0.2488	0.009882	2.816E-5	0.2318	0.248	0.2704	5001	100000
	pN[4]	0.2312	0.008331	2.386E-5	0.2161	0.2308	0.2488	5001	100000
	pN[5]	0.2104	0.008425	2.495E-5	0.1933	0.2106	0.2265	5001	100000
	pN[6]	0.1909	0.01061	3.211E-5	0.1682	0.1916	0.2099	5001	100000
	pN[7]	0.1737	0.01309	3.978E-5	0.1457	0.1745	0.197	5001	100000
	pN[8]	0.1589	0.01517	4.606E-5	0.1267	0.1597	0.1862	5001	100000
	pN[9]	0.1461	0.01676	5.081E-5	0.1111	0.1469	0.1767	5001	100000
	pN[10]	0.1351	0.01793	5.427E-5	0.09823	0.1358	0.1684	5001	100000
	pN[11]	0.1255	0.01877	5.67E-5	0.08755	0.126	0.1608	5001	100000
1c. ANOVA:  Diasorin data with large variance for means, equal variance.  
    Group 1 is low; group 2 is normal; group 3 is high bone turnover
 model
 {
 for(i in 1:n1){
   loglow[i] <- log(low[i])
   loglow[i] ~ dnorm(mu1, tau)
   }
 for(i in 1:n2){
   lognormal[i] <- log(normal[i])
   lognormal[i] ~ dnorm(mu2, tau)
   }
  for(i in 1:n3){
   loghigh[i] <- log(high[i])
   loghigh[i] ~ dnorm(mu3, tau)
   }
 mu1 ~ dnorm(4.87, 0.001)
 mu2 ~ dnorm(5.39, 0.001)
 mu3 ~ dnorm(6.40, 0.001)
 tau ~ dgamma(0.001,0.001)
 P <- step(mu3-mu2)*step(mu2-mu1)*step(mu3-mu1)  
 loglowf ~ dnorm(mu1, tau)
 lognormalf ~ dnorm(mu2, tau)
 loghighf ~ dnorm(mu3, tau)
 diff21 <- mu2-mu1
 diff31 <- mu3-mu1
 diff32 <- mu3-mu2
 prob21 <- step(diff21)
 prob31 <- step(diff31)
 prob32 <- step(diff32)
 med1 <- exp(mu1)
 med2 <- exp(mu2)
 med3 <- exp(mu3)
 relmed21 <- med2/med1
 relmed31 <- med3/med1
 relmed32 <- med3/med2
 MAD <- (abs(diff21)+abs(diff31)+abs(diff32))/3
 prob <- step(MAD-0.75)
 }
 list(n1=19,n2=15, n3=50,
 low = c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,233,101,25,70,357),
 normal = c(370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404),
 high = c(75,52,1378,555,331,231,472,263,120,46,650,349,251,492,759, 96, 
 627,171,1584,69,368,509,486,354,351,839,88,162,1041,383,234,1130,503,244,606,
 457,460,283,767,576,628,239,583,428,452,723,201,406,422,243))
 list(mu1=4.87, mu2=5.39, mu3=6.4, tau=1, loglowf=50, lognormalf=50, loghighf=50)
Results

node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	MAD	0.7705	0.1566	4.495E-4	0.4636	0.7698	1.079	5001	100000
	diff21	0.7855	0.3043	8.759E-4	0.1899	0.7845	1.384	5001	100000
	diff31	1.145	0.2369	6.867E-4	0.6771	1.145	1.608	5001	100000
	diff32	0.3599	0.2585	7.966E-4	-0.1467	0.3596	0.8661	5001	100000
	loghighf	5.851	0.8884	0.002805	4.115	5.85	7.61	5001	100000
	loglowf	4.701	0.9042	0.002902	2.932	4.7	6.477	5001	100000
	lognormalf	5.49	0.9064	0.002953	3.692	5.49	7.259	5001	100000
	med1	112.7	22.99	0.06646	74.34	110.5	164.1	5001	100000
	med2	248.5	57.14	0.1762	155.4	242.2	378.0	5001	100000
	med3	349.8	43.84	0.1413	272.1	347.1	444.2	5001	100000
	mu1	4.704	0.2017	5.823E-4	4.309	4.705	5.1	5001	100000
	mu2	5.49	0.2265	6.927E-4	5.046	5.49	5.935	5001	100000
	mu3	5.85	0.1247	4.003E-4	5.606	5.85	6.096	5001	100000
		P	0.9134	0.2812	9.078E-4	0.0	1.0	1.0	5001	100000
	prob	0.5517	0.4973	0.001477	0.0	1.0	1.0	5001	100000
	prob21	0.9949	0.07123	2.494E-4	1.0	1.0	1.0	5001	100000
	prob31	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob32	0.9185	0.2735	8.571E-4	0.0	1.0	1.0	5001	100000
	relmed21	2.297	0.7177	0.002095	1.209	2.191	3.989	5001	100000
	relmed31	3.233	0.7779	0.002265	1.968	3.143	4.994	5001	100000
	relmed32	1.482	0.3899	0.001204	0.8636	1.433	2.378	5001	100000
	tau	1.323	0.2081	6.694E-4	0.9476	1.312	1.761	5001	100000

1d. ANOVA:  Diasorin data with diffuse priors, equal variance

 model
 {
 for(i in 1:n1){
   loglow[i] <- log(low[i])
   loglow[i] ~ dnorm(mu1, tau)
   }
 for(i in 1:n2){
   lognormal[i] <- log(normal[i])
   lognormal[i] ~ dnorm(mu2, tau)
   }
  for(i in 1:n3){
   loghigh[i] <- log(high[i])
   loghigh[i] ~ dnorm(mu3, tau)
   }
 mu1 ~ dnorm(0,0.001)
 mu2 ~ dnorm(0,0.001)
 mu3 ~ dnorm(0,0.001)
 tau ~ dgamma(0.001,0.001)
 P <- step(mu3-mu2)*step(mu2-mu1)*step(mu3-mu1)   
 loglowf ~ dnorm(mu1, tau)
 lognormalf ~ dnorm(mu2, tau)
 loghighf ~ dnorm(mu3, tau)
 diff21 <- mu2-mu1
 diff31 <- mu3-mu1
 diff32 <- mu3-mu2
 prob21 <- step(diff21)
 prob31 <- step(diff31)
 prob32 <- step(diff32)
 med1 <- exp(mu1)
 med2 <- exp(mu2)
 med3 <- exp(mu3)
 relmed21 <- med2/med1
 relmed31 <- med3/med1
 relmed32 <- med3/med2
 MAD <- (abs(diff21)+abs(diff31)+abs(diff32))/3
 prob <- step(MAD-0.75)
 }
 list(n1=19,n2=15, n3=50,
 low = c(91,46,95,60,33,410,105,43,189,1097,54,178,114,137,233,101,25,70,357),
 normal = c(370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404),
 high = c(75,52,1378,555,331,231,472,263,120,46,650,349,251,492,759, 96, 
 627,171,1584,69,368,509,486,354,351,839,88,162,1041,383,234,1130,503,244,606,
 457,460,283,767,576,628,239,583,428,452,723,201,406,422,243))
 list(mu1=4.87, mu2=5.39, mu3=6.4, tau=1, loglowf=50, lognormalf=50, loghighf=50)
Results

     node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	MAD	0.7706	0.1566	4.495E-4	0.4637	0.7698	1.079	5001	100000
	diff21	0.7854	0.3043	8.759E-4	0.1898	0.7844	1.383	5001	100000
	diff31	1.146	0.2369	6.867E-4	0.6772	1.145	1.608	5001	100000
	diff32	0.3601	0.2585	7.966E-4	-0.1465	0.3598	0.8664	5001	100000
	loghighf	5.851	0.8884	0.002805	4.115	5.85	7.61	5001	100000
	loglowf	4.701	0.9042	0.002902	2.932	4.7	6.477	5001	100000
	lognormalf	5.489	0.9064	0.002953	3.692	5.49	7.259	5001	100000
	med1	112.7	22.98	0.06645	74.32	110.5	164.1	5001	100000
	med2	248.4	57.12	0.1762	155.3	242.1	377.9	5001	100000
	med3	349.8	43.84	0.1413	272.1	347.1	444.1	5001	100000
	mu1	4.704	0.2017	5.823E-4	4.308	4.705	5.1	5001	100000
	mu2	5.489	0.2265	6.927E-4	5.045	5.489	5.935	5001	100000
	mu3	5.85	0.1247	4.003E-4	5.606	5.85	6.096	5001	100000
	P	0.9136	0.281	9.083E-4	0.0	1.0	1.0	5001	100000
	prob	0.5518	0.4973	0.001474	0.0	1.0	1.0	5001	100000
	prob21	0.9949	0.07123	2.494E-4	1.0	1.0	1.0	5001	100000
	prob31	1.0	0.0	3.162E-13	1.0	1.0	1.0	5001	100000
	prob32	0.9187	0.2733	8.564E-4	0.0	1.0	1.0	5001	100000
	relmed21	2.297	0.7176	0.002094	1.209	2.191	3.989	5001	100000
	relmed31	3.234	0.778	0.002265	1.968	3.144	4.994	5001	100000
	relmed32	1.482	0.3899	0.001204	0.8638	1.433	2.378	5001	100000
	tau	1.323	0.2081	6.694E-4	0.9477	1.312	1.761	5001	100000

2. ANOVA with hierarchical prior

model{
 for(i in 1:I){
  mu[i]~dnorm(theta,tau.mu)
  for(j in 1:n[i]){
   logy[j, i] <- log(y[j, i])
   logy[j, i]~dnorm(mu[i],tau)   
  }
 }
 tau~dgamma(c,d)    
 theta~dnorm(a,b)
 tau.mu~dgamma(c.mu,d.mu)
 sigma <- sqrt(1/tau)   
}
list(I=3, n=c(19,15,50), c=0.001,d=0.001,c.mu=0.001,d.mu=0.001,a=0,b=0.000001)
list(mu=c(0,0,0),tau=1,tau.mu=1,theta=0)
Approach 1

This is just to illustrate that with the data in the following format of a non-rectangular array (due to different sample sizes in the 3 groups), the code won't run.
y[,1]  y[,2]  y[,3]
91	370	75
46	267	52
95	99	1378
60	157	555
33	75	331
410	1281	231
105	48	472
43	298	263
189	268	120
1097	62	46
54	804	650
178	430	349
114	171	251
137	694	492
233	404	759
101		96
25		627
70		171
357		1584
		69
		368
		509
		486
		354
		351
		839
		88
		162
		1041
		383
		234
		1130
		503
		244
		606
		457
		460
		283
		767
		576
		628
		239
		583
		428
		452
		723
		201
		406
		422
		243
END

Approach 2

One way around this is to create a complete matrix by filling in the columns with NAs,  and then run the code.  
 Note that none of the NAs factor in because they aren't read by WinBUGS.

y[,1]  y[,2]  y[,3]
91	370	75
46	267	52
95	99	1378
60	157	555
33	75	331
410	1281	231
105	48	472
43	298	263
189	268	120
1097	62	46
54	804	650
178	430	349
114	171	251
137	694	492
233	404	759
101	NA	96
25	NA	627
70	NA	171
357	NA	1584
NA	NA	69
NA	NA	368
NA	NA	509
NA	NA	486
NA	NA	354
NA	NA	351
NA	NA	839
NA	NA	88
NA	NA	162
NA	NA	1041
NA	NA	383
NA	NA	234
NA	NA	1130
NA	NA	503
NA	NA	244
NA	NA	606
NA	NA	457
NA	NA	460
NA	NA	283
NA	NA	767
NA	NA	576
NA	NA	628
NA	NA	239
NA	NA	583
NA	NA	428
NA	NA	452
NA	NA	723
NA	NA	201
NA	NA	406
NA	NA	422
NA	NA	243
END

	
Approach 3

We can alternatively specify the data like this, which still must include the NAs.  WinBUGS fills a matrix by row.  The rows of y are the 3 groups, and the 50 columns are the data points in each group.  Because of this, we need to switch i and j in the log statements of the code listed above.  

model{
 for(i in 1:I){
  mu[i]~dnorm(theta,tau.mu)
  for(j in 1:n[i]){
   logy[i, j] <- log(y[i, j])
   logy[i, j]~dnorm(mu[i],tau)   
  }
 }
 tau~dgamma(c,d)    
 theta~dnorm(a,b)
 tau.mu~dgamma(c.mu,d.mu)
 sigma <- sqrt(1/tau)   
} 
list(mu=c(0,0,0),tau=1,tau.mu=1,theta=0)
 list(I=3, n=c(19,15,50), c=0.001,d=0.001,c.mu=0.001,d.mu=0.001,a=0,b=0.000001,
    y=structure(.Data=c( 91, 46,  95,  60, 33, 410, 105, 43, 189,1097, 54,178, 114, 137, 233, 101, 25,70,357,NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 370, 267, 99,157, 75,1281, 48, 298, 268, 62,804,430,171,694,404, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 75,   52, 1378,  555,  331,  231,  472,  263,  120,   46,  650,  349,  251,  492,  759,  96,  627,  171, 1584,   69,  368,  509,  486,  354,  351,  839,   88,  162, 1041,  383, 234, 1130,  503,  244,  606,  457,  460,  283,  767,  576,  628,  239,  583,  428,  452, 723,  201,  406,  422,  243), .Dim=c(3,50)))

Results from Approach 2

	 node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	mu[1]	4.788	0.2118	0.001281	4.375	4.786	5.211	10001	50000
	mu[2]	5.472	0.2152	8.935E-4	5.047	5.472	5.895	10001	50000
	mu[3]	5.823	0.1256	6.199E-4	5.575	5.823	6.071	10001	50000
	sigma	0.8789	0.07021	3.252E-4	0.7551	0.8743	1.028	10001	50000
	tau	1.319	0.2078	9.523E-4	0.9461	1.308	1.754	10001	50000
	tau.mu	4.611	16.08	0.143	0.0854	2.404	19.5	10001	50000
	theta	5.353	0.9604	0.004726	3.968	5.366	6.707	10001	50000

Results from Approach 3

node	 mean	 sd	 MC error	2.5%	median	97.5%	start	sample
	mu[1]	4.788	0.2118	0.001281	4.375	4.786	5.211	10001	50000
	mu[2]	5.472	0.2152	8.935E-4	5.047	5.472	5.895	10001	50000
	mu[3]	5.823	0.1256	6.199E-4	5.575	5.823	6.071	10001	50000
	sigma	0.8789	0.07021	3.252E-4	0.7551	0.8743	1.028	10001	50000
	tau	1.319	0.2078	9.523E-4	0.9461	1.308	1.754	10001	50000
	tau.mu	4.611	16.08	0.143	0.0854	2.404	19.5	10001	50000
	theta	5.353	0.9604	0.004726	3.968	5.366	6.707	10001	50000