
10.9 Exercises 393
this difference falling in the interval (−2,2). The posterior probability of (−2,2)
should be close to 1 (say, 0.95) in order to declare equivalence.
model{
for(i in 1:n) {
increase[i] ~ dnorm(mu[type[i]], prec)
}
mu[1] ~ dnorm( 10, 0.00001)
mu[2] ~ dnorm( 10, 0.00001)
mudiff <- mu[1]-mu[2]
prec ~ dgamma(0.001, 0.001)
probint <- step( mudiff + 2)
*
step(2 - mudiff)
}
DATA
list( n=43, increase = c(7, 8, 4, 6, 10, 10, 5, 7, 9,
8, 6, 7, 8, 4, 6, 10, 8, 9, 6, 7, 5, 9, 5, 5, 3, 7, 5,
10, 8, 5, 8, 4, 4, 8, 6, 11, 7, 5, 5, 5, 7, 4, 6 ),
type = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2))
INITS
list( mu = c(10, 10), prec = 1)
mean sd MC error val5.0pc median val95.0pc start sample
mudiff 1.133 0.6179 6.238E-4 0.117 1.133 2.147 10001 1000000
probint 0.9213 0.2693 2.766E-4 0.0 1.0 1.0 10001 1000000
The Bayesian analysis closely matches the findings by TOST and West-
lake’s interval. Note that the posterior probability of the tolerance interval
(
−2,2) is 0.9213, short of 0.95. Also, the 90% credible set (0.117,2.147) is close
to Westlake’s interval (0.1186,2.1481). This closeness is a consequence of non-
informative priors on the means and precision.
10.9 Exercises
10.1. Testing Piaget. Two groups of elementary school students are taught
mathematics by two different methods: traditional (group 1) and small
group interactive teaching by discovery based on Piagetian theory (group 2).
The results of a learning test are analyzed to test the difference in mean
scores using the two methods. Group 1 had 16 students while group 2 had
14 students and the scores are given below.
Groups Scores
Traditional 80, 69, 85, 87, 74, 85, 95, 84, 87, 86, 82, 91, 79, 100, 83, 85
Piagetian 100, 89, 87, 76, 93, 68, 99, 100, 78, 99, 100, 74, 76, 97