OpenBUGS
Posts  1 - 1  of  1
bwtegu
I am new to OpenBUGS and am trying to set up a model with a different mean length and variance at maturity for males and females together, then for males versus females fish (assume the precision is the same for both sexes).

I am trying to figure out how to get the model to discriminate between the two sexes (male=1, female=2) from the data.

Any suggestions on how to set up the model would be great. Thanks.

The model I have set up looks like this:

model
{
mean[1] ~ dnorm(0, 1.0E-6)
mean[2] ~ dnorm(0, 1.0E-6)
var ~ dlnorm(0.0, 1.0E-6)

prec <- 1/var
for (i in 1:N)
{
lmat[i] ~ dnorm(mean[sex[i]], prec)
}
}

Data
list(lmat=c(13.8, 20.2, 20.2, 24.4, 17.8, 15.1, 16.6, 11.7, 18.2, 8.2, 14, 13.9, 16.3, 18.4, 17.1, 21.2, 21.8, 20.7, 19.2, 20.9, 30.8, 23.3, 22, 22.5, 20.7, 16.3, 24.4, 18.2, 28, 23.5), sex=c(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),N=30)

Save
Cancel
Reply
 
x
OK