I am building a multilevel model with students at level 1 and instructors at level 2 and I have variables at each level to indicate the gender of the students and their instructors (see coding below). What is the best way to compare students of the same gender as their instructor with students of the opposite gender as their instructors on the outcome variable?
What I have Tried:
- I’ve tried writing code in SAS for a simple interaction (Student_Gen x Inst_Gen). In the output, though, with the way the variables are coded (either a 0 or 1), I only get one estimate—which makes sense. If female students and female instructors are both 1, I get the coefficient for that pair (Female-Female) in comparison to the others. I can get one coefficient for any of the four possible options (Female-Female, Male-Male, Female-Male, Male-Female) based on the coding. But is there another way to code these variables that would allow me to make the comparison I’m trying to make?
- I’ve tried creating a new variable where 0 = different gender and 1 = same gender. However, when I add this variable to my model, SAS does not give me an estimate at all—or even an error message, for that matter. I suspect that it has something to do with the unusual degrees of free available with the new variable that is preventing the software from knowing whether to classify it as a level 1 or level 2 variable—but that is just a guess. Any and all suggestions would be greatly appreciated.
Current Variable Coding
Male Student = 0 Female Student = 1
Male Instructor = 0 Female Instructor = 1