I'm new to R, and despite trying to read as much as I can about how lmer works in R, I still don't feel like I know how to correctly specify more complex models using the lmer syntax.
For example, at the moment I want to use lmer for a two-level multilevel model, where the first level is features of a specific course taken by a specific student in a specific semester (with covariates like kind of course, teaching method, etc) and the second level is the student, which also has a number of covariates (e.g. ethnicity, gender, age, gpa at the beginning of the study, and score on a specific instrument). I also want to assess interactions with the teaching method, for example by including cross-level interactions between the second-level covariates ethnicity, gender, age, gpa, and the instrument score and the first-level covariate teaching method.
For the sake of readability, let's limit the equation to teaching method, course type, and score. It seems to me that I have seen three different ways of doing something like what I want to do in R - they are clearly all specifying something somewhat different, but I can't figure out what the underlying math is supposed to be for each case. So, for example, in different online references and the books on MLM that I have on hand, it seems that one of these three models is recommended for what I want to do:
course_outcome ~ course_type*teaching_method + score*teaching_method + (1|student)
course_outcome ~ course_type*score + (teaching_method|student)
course_outcome ~ course_type*teaching_method + score*teaching_method + (teaching_method|student)
I'm a little confused about the differences between how lmer interprets each of these three codings - is there any chance that someone who really understands R better could possibly translate this into the basic regression equation(s) structure that would be calculated in each of these three examples? Or direct me to a reference that might more clearly explain the difference by giving the regression equations for each case?
Thanks for your time!