I have data with two between-subjects variables. Since this data is unbalanced, I am trying to use the linear mixed-effects modeling to see if the interaction between the variables is a significant predictor of DV. But I am not sure if I modeled the data correctly, and I was wondering if I could get some help here since I am a beginner in mixed linear modeling.
To explain more about my data, the between-subjects variables (fixed effects) are:
- Curriculum (Curriculum A, Curriculum B), and the
- Class mode (In-person, Online). So, there could be four groups (Curriculum A & In-person, Curriculum A & Online, Curriculum B & In-person, Curriculum B & Online) to which each participant could be assigned. Each participant was assigned to only one of these groups.
I would like to know if there was a significant interaction effect between Curriculum and Class mode on the Test Score (DV). I am using Matlab’s fitlme function, but I am aware that the syntax for the mixed effect model function is pretty similar in R. My initial thought was that I can model the data like the following (Result1). By the way, ‘LME2’ is a matrix that contains the data, the ‘subjectID2’ column contains the participant number, and (1|subjectID2) is a way of specifying the random intercept for 'subjectID2' in Matlab.
Result1=fitlme(LME2, 'testScore ~ curriculum * classMode + (1|subjectID2)', 'FitMethod', 'REML');
However, it came to my thought that I should be controlling for the random intercept arising from the fixed effects ‘curriculum’ and ‘classMediam’, so I revised the line as follows:
Result2=fitlme(LME2, 'testScore ~ curriculum * classMode + (1|subjectID2) + (1|curriculum) + (1|classMode)', 'FitMethod', 'REML');
My specific questions are:
- Based on the design of the study, which is the correct way of modeling the data? Result1 or as Result2?
- If the ‘Result2’ model is correct, should I remove the intercept term for subjectID2 (1|subjectID2)? I feel like since I am controlling for the random intercepts of the groups ‘curriculum’ and ‘classMediam’, it may be unnecessary to control for the random intercept for the subject, but this is just a guess.
- If you use Matlab to fit LME models, is there a way of specifying the AR2 matrix as the covariance matrix? It seems that Matlab only has Cholesky, Diagonal, Isotropic, and Compound Symmetry matrices as options.
Thank you in advance!
Hansol R.