Announcement

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

  • Specifying crossed and nested random effects using mixed

    I am trying to specify a model using the mixed command with cross random effects nested within a group and need help in writing the command.

    The data structure has teacher and observer crossed effects and teachers and observers are nested within schools. This was my attempt at writing the command:

    Code:
     mixed outcome || schools: || _all: R.observer || teacher:
    Can someone confirm that this model reflects the data structure I described? Thank you!

  • #2
    Looks right to me.

    Unsolicited advice: This is a fairly complicated data structure. I'm also trying to imagine how the data were actually collected and, while I imagine there were plenty of schools and teachers, I wonder about the number of observers. If it was only a small number of observers, then you would have only a small sample of observer space from which to calculate the variance at the observer level. In situations like that, it is often simpler and better not to use a level at the observer level and use i.observer as a fixed effect instead. Of course, if estimating variation at the observer level is a goal of your study, then you need to keep that level in the model. But in that case, your sample maybe under-powered for your purposes unless the number of observers is large.

    Comment


    • #3
      Thanks, Clyde. Bonus points to you for a speedy and insightful response!

      Comment


      • #4
        Although the code above solved my original problem, I began thinking about a hypothetical scenario and wondered how one might model this new scenario in Stata using the "mixed" command.

        Here's the new scenario: teachers are nested within schools, but observers are crossed with both schools and teachers. The difference between this case and the original structure is that observers are no longer nested in schools. I'm wondering if this is how to write the command for the new scenario:
        Code:
        mixed outcome || schools: || teacher: || _all: R.observer
        Any feedback is appreciated

        Comment

        Working...
        X