Hey

I’m not quite sure about how to code for repeated measures. I’ve read about the usage of the symbol “I” (varies within grouping factor). I have a 2x2 factorial design with multiple dependent variables, all of which measured with baseline and 4 additional measures. The dependent variables are all about well-being and as such not only interdependent, but should have different baseline values. Because of this, I’m interested in the change in the dependent variables after treatment (each participant will only do 1 treatment four times, with four measurements of the dependent variables after each session. I will do this with BFpack and as a multivariate regression.

As far as I have come, the code (without repeated measures) should be:

*mlm1 ← lm(cbind(y1,y2,y,3) ~ x1 * x2 + data = well-being*

*BF1 <-BF (mlm1, hypothesis = constraints)*

*summary (BF1)*

I assume for my purpose, I would need to include the measurement time as additional independent variable, created as a vector including all 3 dependent variables:

*mlm1 ← lm(cbind(y1,y2,y,3) ~ x1 * x2 * measuretime(y-vector) + data = well-being*

Is that right?

Would I still need to code the dependency? I would say, I need the additional command:

*+ (1Iperson)*

I’ve also heard, that a solution could be

*+ (1+measuretimeIperson)?*

but as I’ve already included measuretime as predictor, I thought that doesn’t make sense.

On the other hand, I was told to use multilevel multivariate regression to separate between subjects variability from within subjects variability (change). But in the tutorial for “BFpack: Flexible Bayes Factor Testing of Scientific Theories in R”, p. 40 ff.) it only checks, if the multilevel approach is approriate. It also seems to me (p.42), that in this expample the coding selects, if the variability in a third level is relevant for a participant, by clustering it to a second level condition. But as every participant will do the same amount of repeated measures, I’m not sure, if I need such a nested coding, or if that above is enough:

"The sample design of the TIMSS data set is known to

describe three levels with students nested within classrooms/schools, and classrooms/schools

nested within countries (e.g., one classroom is sampled per school):

*R> library(“lme4”)*

*R> timssICC_subset ← subset(timssICC, groupNL11 == 1 | groupHR11 == 1 |*

*+ groupDE11 == 1 | groupDK11 == 1)*

*R> lmer7 ← lmer(math ~ -1 + gender + weight + lln +*

*+ groupNL11 + (0 + groupNL11 | schoolID) +*

*+ groupHR11 + (0 + groupHR11 | schoolID) +*

*+ groupDE11 + (0 + groupDE11 | schoolID) +*

*+ groupDK11 + (0 + groupDK11 | schoolID),*

*+ data=timssICC_subset)*

*R> print(lmer7)*

where the schoolID factor variable assigns a unique code to each school, and each countryspecific group variable (e.g., groupNL11) equals one when it concerns a school in that country

and zero otherwise. As the interest is mainly on the random effects variances, we only print

(via print(lmer7)) these here (to keep the current presentation of the results as concise as

possible):

Random effects:

*Groups Name Variance Std.Dev.*

*schoolID groupNL11 356.2 18.87*

*schoolID.1 groupHR11 477.8 21.86*

*schoolID.2 groupDE11 633.0 25.16*

*schoolID.3 groupDK11 831.3 28.83*

*Residual 3429.6 58.56*

*Number of obs: 8655, groups: schoolID, 577*

If you have any paper in mind, which could help me on this, I would be grateful. Sorry for the complicated post :)

Jakob