I'm new to repeated measures and am trying to understand how it maps to lmer.
I have measurements from two time periods:
$t_1, t_2$.
At each measurement period, the same 50 different foods are scored side-by-side from two vendors. Three different judges score each food. We have an aggregate score for each food (average). We also have an aggregate for each vendor at each time period (average of all food scores).
We want to assess if there's a significant difference in the performance between the vendors over the two time periods.
If this was just within one time period, I think I would do this as follows:
y ~ vendor + (1 | food)
.
So a varying-intercept model with random effect for food and fixed effect for vendor.
However, I don't understand how to do this over two time periods and maintain the variance reduction from both pairing items within each time period and between each time period.
I thought this might be appropriate:
y ~ vendor + period + period:vendor + (1 + period| food)
.
Is this correct? I consult this and this thread as reference.