I've just been (re-)reading Gelman's Why we (usually) don't have to worry about multiple comparisons. In particular the section "Multiple outcomes and other challenges" mentions using a hierarchical model for situations when there are multiple related measures from the same person/unit at different times/conditions. It appears to have a number of desirable properties.
I understand that this is not necessarily a Bayesian thing. Could somebody show me how to properly construct a multivariate multilevel model using rjags and/or lmer (regular JAGS and BUGS should be fine too, as well as other mixed model libraries e.g., MCMCglmm) so that I can play around with it to compare and contrast results? The type of situation I would like a model for is reflected in the toy data below (multivariate, repeated measures):
set.seed(69) id <- factor(rep(1:20, 2)) # subject identifier dv1 <- c(rnorm(20), rnorm(20, 0.8, 0.3)) # dependent variable 1 data for 2 conditions dv2 <- c(rnorm(20), rnorm(20, 0.3, 0.6)) dv3 <- c(rnorm(20), rnorm(20, -0.3, 0.8)) dv4 <- c(rnorm(20), rnorm(20, 0.2, 1 )) dv5 <- c(rnorm(20), rnorm(20, 0.5, 4 )) rmFac <- factor(rep(c(1, 2), each=20)) # repeated measures factor dvFac <- factor(rep(1:5, each=40)) # dependent variable indicator dfwide <- data.frame(id, dv1, dv2, dv3, dv4, dv5, rmFac) dflong <- data.frame(id, dv = c(dv1, dv2, dv3, dv4, dv5), rmFac, dvFac) # just in case it's easier?