Just quickly, I’m using JAGS with rjags to run some models for this fungal concentration paper I’m writing with our Finnish visitor (who leaves in a few months!). There are three levels of hierarchy in the experiment

- school (i = 1 to 25)
- measurement site within school (j = 1 to 3)
- sample number at measurement site (k = 1 to K
_{j})

which mean that I was constructing my data frame as a three dimensional array, y[i,j,k] where there were uneven numbers of samples at each site within each school. Furthermore, modelling y[i,j,k] ~ dnorm(mu[i,j,k],tau.y) was giving me problems because I couldn’t tell JAGS to monitor a three dimensional parameter.

I figured out that it’d just be easier to treat the levels of measurement site and sample number as covariates that I could use as index counters in JAGS. I’ve got much simpler code now and JAGS is monitoring mu[i] (i = 1 to 261).

Edit: It’s been a busy month. I hope to finally publish that blog post about SEB113 soon.

### Like this:

Like Loading...

*Related*

MattThe BUGS manual suggests 3 different ways of handling unbalanced or “ragged” datasets – I think I’ve tried all 3 at one time or another.