I have a data structure that requires a mixed effects model - specifically, I have 3 crossed (rather than nested) factors with random intercepts. The number of levels for each of the 3 random factors is:
level 1: 25
level 2: 29
level 3: 58
I am trying to determine how linear is the relationship between a variable X and a dependent variable Y. The first thing I thought of is a scatterplot. However, because of the data structure, I am not sure that I can just plot X v. Y. How to address? Should I plot separate scatterplots by each level? For example for level 3, show the relationship for each of the 58 members of level 3? How to do that?
In the mixed effects model, I will then include X and X^2 in the model, and determine if X^2 is statistically significant, and then if it is, include a cubed term, and so on. When assessing non-linearity, is there anything else I should do?
Note: this is not a longitudinal dataset.