4
$\begingroup$

I've run an experiment where participants (PP) viewed 40 quotes (Item) and rated them (Rating). Subjects were split into two groups where the font of the quotes was manipulated (Font). For both groups, the quotes they viewed were of two types (QuoteType) and also of two varying metrics (Metrics). This led to a total of four exposures - two Font groups where Metrics were counterbalanced, and thus 160 variations of stimuli (40 x 2 x 2).

My hypothesis is that Rating can be predicted as a product of a Font*QuoteType interaction. My secondary hypothesis is that a significant effect of Metrics should also emerge. I have no problems specifying my fixed effects - which have been contrast coded - but I am uncertain about the random effects. Here's my lmer model:

lmer(Rating~Font*QuoteType + Metrics + (1+QuoteType|PP) + (1+Font|Item), ProfJData) 

I specified (1+QuoteType|PP) as I imagined that every PP's intercept will differ by QuoteType, and the same for Item. However, since | refers to "within each" - i.e, grouping variable - and since my Font variable is a between-subjects factor, should I not be specifying the model like so?

lmer(Rating~Condition*QuoteType + Metrics + (1+PP|Font) + (1+Font|Item), ProfJData)

Wouldn't this mean that participants are grouped into Font? I'm uncertain about this as I usually see PP as a grouping factor in most papers.

Any clarification would be highly appreciated.

$\endgroup$

1 Answer 1

3
$\begingroup$
> lmer(Rating~Font*QuoteType + Metrics + (1+QuoteType|PP) + (1+Font|Item), ProfJData) 

This looks OK.

I specified (1+QuoteType|PP) as I imagined that every PP's intercept will differ by QuoteType, and the same for Item.

This seems slightly confused. It is not that every PP's intercept will differ by QuoteType - rather that every PP will have their own estimate for QuoteType. In other words you have random intercepts for PP (because it is a grouping variable) and you have random slopes for QuoteType. QuoteType is also a fixed effect which is perfectly normal, so there is a global "effect" of QuoteType (fixed effect) and random deviations from it for each PP.

However, since | refers to "within each" - i.e, grouping variable- and since my Font variable is a between-subjects factor, should I not be specifying the model like so?

Again there is some confusion. You can read | as "within each" but it is important to know that on the right side you are specifying a grouping variable and fitting random intercepts for it. You have repeated measures within Item (because each item was viewed by all participants), and similarly for PP. What comes on the left side is a global fixed effect which is also allowed to vary at the diffeent levels of whatever is on the right.

lmer(Rating~Condition*QuoteType + Metrics + (1+PP|Font) + (1+Font|Item), ProfJData) 

Wouldn't this mean that participants are grouped into Font?

No, it means that each level of PP would vary by the grouping factor Font which doesn't make sense.

I'm uncertain about this as I usually see PP as a grouping factor in most papers.

Yes, you need PP as a grouping factor.

$\endgroup$
1
  • $\begingroup$ Thank you again for your helpful response. I was quite sure about my initial formula but came across a paper today that did indeed confuse my understanding of random effects. Your explanation has once again made things much more clearer. $\endgroup$
    – NickB
    Jul 14, 2020 at 9:58

Your Answer

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

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