########################################################################

# Grouped Data 1

########################################################################

model

{

y[1:6] ~ dmulti(theta[1:6], n)      # likelihood

theta[1] <-    phi( (height[1]-mu)/sigma )

theta[6] <-  1-phi( (height[5]-mu)/sigma )

for(i in 2:5)

{

theta[i]<- phi( (height[i]-mu)/sigma ) - phi( (height[i-1]-mu)/sigma )

}

mu     ~ dnorm(0, 0.000001)   # approximates the improper prior

lsigma ~ dnorm(0, 0.000001)   # approximates the improper prior

sigma  <- exp(lsigma)

}           

# Data

list( n = 211, y = c(14, 30, 49, 70, 33, 15),  height = c(66, 68, 70, 72, 74))

# Initial values

list( mu = 70, lsigma=0 )

########################################################################

 

# For scatter plot of mu and lsigma, Inference -> Correlations -> scatter