########################################################################
# Grouped Data 2
Use I(lower,upper) for
censoring (not for truncation)
########################################################################
model
{
for (i in 1:14)
{
y1[i] ~ dnorm(mu,
tau)I(, height[1]) #
likelihood
}
for (i in 1:30)
{
y2[i] ~ dnorm(mu,
tau)I(height[1], height[2]) #
likelihood
}
for (i in 1:49)
{
y3[i] ~ dnorm(mu,
tau)I(height[2], height[3]) #
likelihood
}
for (i in 1:70)
{
y4[i] ~ dnorm(mu,
tau)I(height[3], height[4]) #
likelihood
}
for (i in 1:33)
{
y5[i] ~ dnorm(mu,
tau)I(height[4], height[5]) #
likelihood
}
for (i in 1:15)
{
y6[i] ~ dnorm(mu,
tau)I(height[5],) #
likelihood
}
mu
~ dnorm(0, 0.000001) # approximates the
improper prior
tau ~ dgamma(0.0001, 0.0001) #
approximates the improper prior
sigma
<- 1/sqrt(tau)
lsigma <- log(sigma)
}
# Data
list( height = c(66, 68, 70, 72, 74))
# Initial
values: load the values below first and then "gen.inits"
list( mu = 70, tau=1 )
########################################################################
# For scatter plot of mu and lsigma,
Inference -> Correlations -> scatter