Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mixed effects model with cross-classified data

    I would like to perform a mixed effect linear model with cross-classified data but am struggling to find the correct syntax. The study design has multiple schools in which multiple teachers in that school complete the same assessment on different students in the same school. The assessments were performed at two different timepoints during which the teachers and students are still in the same school but not necessarily paired at both points. If I were interested in student gender as a predictor for the score and want to model school, teacher and student as random effects, what would be the appropriate syntax for doing this? I have tried two different approaches but the "grouping information" output is confusing, making me uncertain which is the correct one.

    The first syntax (created based on my reading and understanding of the manual and other examples) was: mixed score gender time || school: || _all: R.teacher || studentID: , covariance(unstructured)

    The alternative syntax (generated by the drop down menus) is: mixed score gender time || school: ,covariance(unstructured) || teacher:R. studentID , covariance(identity)

    Can you please tell me if either one is correct and if neither, what would be the correct syntax?

    Thank you!

  • #2
    Take a look at an old post by Yulia Marchenko here where she shows the syntax for such a model. In that post, she uses xtmixed, which is the name of a previous version of mixed.

    Comment


    • #3
      Thank you! Looking at that post, then, it appears that this would be the correct model to use:

      mixed score gender time || school: || _all: R.teacher || studentID: , covariance(unstructured)

      thank you again.

      Comment


      • #4
        Your syntax with the
        Code:
        _all: R.
        at the teacher level seems right to me, given your description. You do not need the unstructured covariance option in your syntax unless you are specifying random slopes - variables for which you are allowing their association with the outcome to vary across groups in a level. For example, if you wanted to allow the association between student gender to vary based on school or teacher.

        Comment


        • #5
          thanks!

          Comment

          Working...
          X