1

I've been running several mixed linear models in R. I use the lmer function from lmerTest. I also ran the same analyses (or so I thought) in JASP. JASP uses R behind the scenes and shows you the R code. It turns out that JASP constructs a different model (see 1 below) than I did (see 2 below).

Short question: What is the difference between the two model specifications below?

Model 1:

value ~ variable + (1 + variable | topic) + (1 + variable | ResponseId)

Model 2:

value ~ variable + (1|ResponseId) + (1|topic)
  • value is a continuous dependent variable.
  • variable and topic are within-subject random variables (factor)
  • ResponseId is the subject id (factor)

1 Answers1

0

There is another, more general, question on StackExchange: R's lmer cheat sheet. The resources linked there might be able to address my question. In particular, it seems that the form

(1 + ResponseId)

only allows for a random intercept per responseId. In contrast, the form

(1 + variable | responseId)

fits different slopes (for the effect of the variable) and different intercepts for each responseId.

It would be nice if someone more knowledgeable could confirm (or correct).

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Mar 18 '23 at 01:58
  • 1
    Greetings! This should not be posted as an answer, as it doesn't provide a solution to the question. – Shawn Hemelstrand Mar 18 '23 at 03:15