Announcement

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

  • Longitudinal Multilevel Model accounting for group change over time

    Hello,

    I want to test whether pre-school attendance has an effect on the performance to a national standardized test during primary and secondary school. I have a longitudinal dataset to do so and my question is whether there is a longitudinal multilevel model in Stata that can account for the fact that school and class change for every individual between primary and secondary school.

    Thank you in advance for any advice!

    Giovanni



    Last edited by Giovanni Piumatti; 31 Jan 2024, 02:19.

  • #2
    It is possible to do this, although depending on how large your sample is, it could be computationally intractable. The most straightforward thing to do is to have a single teacher ID variable that is time-varying. Then you specify the random intercept associated with that variable to be a crossed factor using Stata's _all: R. syntax. See the 2006 Marchenko article about crossed random effects and (xt)mixed. For example, I have some data like yours and you can see the structure I am referring to in the list output below (ClassID is my ID for classroom/teacher).
    Code:
      +------------------------------+
      | ChildID   ClassID   Timepo~t |
      |------------------------------|
      |    1001     10053         21 |
      |    1001     11128         31 |
      |------------------------------|
      |    1002     10450         21 |
      |    1002     12394         31 |
      |------------------------------|
      |    1003     10450         21 |
      |    1003     12251         31 |
      |------------------------------|
      |    1004     10070         21 |
      |    1004     11977         31 |
      |------------------------------|
      |    1005         2         21 |
      |    1005         2         31 |
      |------------------------------|
      |    1006     10284         21 |
      |    1006     12546         31 |
      |------------------------------|
      |    1008     10241         21 |
      |    1008     11812         31 |
      |------------------------------|
      |    1009         2         21 |
      |    1009         2         31 |
      |------------------------------|
      |    1010     10103         21 |
      |    1010         2         31 |
      |------------------------------|
      |    1011     10521         21 |
      |    1011     10998         31 |
      +------------------------------+
    Most children have different ClassIDs but some have the same. To model this in Stata, you would do the following:
    Code:
    mixed outcome predictor || _all:R.ClassID || ChildID:
    You have the additional complication that the school changes. So this needs to be structured similarly and you would use the same _all:R. syntax for the school level. You may want to determine if you can create a supercluster to reduce some of the complexity.
    Code:
    ssc install supclust, replace
    supclust SchoolID ClassID
    Ideally, more than one supercluster is found that subdivides the sample into clusters which both schools and teachers are nested. Then you could use that supercluster in your modeling. See Rabe-Hesketh & Skrondal's Multilevel and Longitudinal Modeling with Stata book. Specifically, the chapter on crossed random effects.

    In my experience, this is a very difficult problem and there may be no ideal solution. There is other software that handles these types of structures better, including MLwiN and even R's lmer(), but no guarantees.

    Comment


    • #3
      Many thanks for these suggestions! I'll look into them!

      Comment

      Working...
      X