5
$\begingroup$

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.

$\endgroup$

1 Answer 1

3
$\begingroup$
y ~ vendor + period + period:vendor + (1 + period| food).

Is this correct?

Yes, this captures the essential idea of repeated measures, and the approach you've outlined is broadly appropriate. I'll explain the components of the model and how each term handles your data structure to ensure it fully aligns with your study design.

The model has the following features:

Fixed Effects:

vendor: Accounts for differences between the two vendors across all foods and periods.

period: Models the differences between the two time periods, capturing any overall change in the scores across periods.

These fixed effects will tell you if there is a significant difference between the two vendors and how the scores change between the two time periods.

period:vendor: This interaction term checks whether the effect of the vendors differs across the two periods, indicating a change in the performance of vendors over time. This is crucial in answering whether the performance of one vendor changes relative to the other over time. A significant interaction indicates a difference in how vendors performed between t1 and t2.

Random Effects:

The random structure (1 + period | food) has a random intercept and slope model. It allows each food to have its baseline score (intercept) and also a unique slope that models changes over time (period effect).

One final thought: If you think judges may have individual biases, consider adding them as a random effect, assuming they scored all foods. In that case you would add this term to the model,

(1 | judge)

However, with only 3 judges, fitting random intercepts is highly questionable, thus you might consider instead fitting fixed effects for judge

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.