Imagine this structure of data:
Each row contains a value for: student_ID, class_ID, teacher_ID, student_Gender, teacher_Gender, submitted_Evalution
The DV of interest is submitted_Evaluation, a binary measure of whether a student submitted an evaluation for a particular class.
Let’s say I am interested in the main effects of student_Gender, teach_Gender, as well as their interaction on the likelihood that a student will submit an evaluation for a class.
Let’s say that each class is only taught by one teacher, but a teacher can teach many classes. So, class_ID is nested in teacher_ID. To an extent, students are nested in classes, but there are some students who take multiple classes (which may be with the same of different teachers). The data are not balanced – i.e., there are far more male students than female students, and the mix likely varies by class and teacher. Most students take only one class, but some take many. In this sense, there are repeated measures per student, but the repetition isn't structured (e.g., by time).
I don’t substantively care about the specific estimates the effects of classes or teachers – just the general effects of gender after controlling for these factors.
I have been trying to formulate a mixed model with random intercepts, but am having trouble specifying the model as students are partially but not fully nested in classes. Specifically, I’m using SAS, and trying models using proc glimmix and proc mixed. Efficiency is key as well – the data set isn’t huge (a couple thousand observations) but many of the specifications I try still cause SAS to hang.
For example, SAS returns an error that the model is too large to fit for the following code:
proc glimmix data=one; class student_Id class_ID teacher_ID student_Gender teacher_Gender ; model Submits_Evaluation(event="1") = student_Gender teacher_Gender student_Gender*teacherGender /dist=binary link=logit solution; random int/ sub=student_ID; random class_ID(teacher_ID)/subject=student_ID; run;
But really, I'm just not sure what types of random or repeated effects I should be specifying -- I am new to mixed models and have been "trying out" a bunch, but can't seem to figure out what really makes sense.
If anyone has any ideas, I would appreciate your input!