I am trying to perform the equivalent of a repeated-measures ANOVA using data that have a non-linear relationship. There are two independent variables: Spacing between stimulus (10, 20, 35, 45, 60), and the number of the stimulus (3-6). The trials are presented in the same block in random order (e.g., trial1 -> 6 stimulus with spacing 20, trial2 -> 4 stimulus with spacing 45, trial3-> 3 stimulus with spacing 60 etc.). What I want to know is the extent the performance is affected by these two variables.

I checked this post: Equivalent to ANOVA for non-linear (quadratic) relationships

Basically, they did a multilevel modelling letting the intercept and coefficients vary by individuals.

Now my question is, can I do the same analysis separately for each level of the 2nd IV (ie, the number of stimulus). Or is it not correct to treat the the levels of the 2nd IV separately? To illustrate what I mean, here is an example:

enter image description here

  • $\begingroup$ I would fit a GAMM. See, e.g., this paper for an introduction. $\endgroup$ – Roland Jun 5 '19 at 13:41

You could indeed specify a quadratic relationship between performance and spacing that is different per stimulus, and test for these differences. For example, you could use something like the R code below, based on lme4:

fm <- lmer(performance ~ poly(spacing, 2) * stimulus + (poly(spacing, 2) | subject),
           data = <your_data>)

This fits a linear mixed model for performance with a quadratic effect for spacing and interaction with stimulus, and random intercepts, and linear and quadratic random slopes. The p-values from the anova() function are based on the Satterthwaite's method for the denominator degrees of freedom.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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