Announcement

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

  • Comparing two and three level models after multiple imputation

    Thank you in advance. I've looked for a similar question on here but can't find anything, so hopefully isn't a replication.

    My data is based on surveys of students in classrooms in schools. My outcome variable is binary (i.e. has/doesn't have mental health difficulties) and I am trying to test whether model fit is significantly better if both classroom and school are modelled (three level) or if just classroom (two level) or just school (two level) are modelled. The research question is about the importance of classroom and school effects in clustering of mental health.

    This is fine without multiple imputation, I run the multilevel models, store the estimates, and use lrtest to compare the models.

    However, I cannot replicate this after multiple imputation because lrtest doesn't work/isn't appropriate. I am using R to do the MI and then transferring data back to Stata (version 17) for the analysis.

    Is there a suggestion of how I can test and compare overall model fit for these nested models.

    My syntax at the simplest level is:

    Three level:

    mi estimate, or cmdok: melogit emo_bin || school: || class:

    Two level (class):

    mi estimate, or cmdok: melogit emo_bin || class:

    Two level (school):

    mi estimate, or cmdok: melogit emo_bin || school:


    A follow on question, for if it is possible to resolve the model fit issue, is that I then wish to run estat icc after the models. Again, not possible after MI. I can calculate the ICCs by hand from the variance components, but can't find a formula for calculating the confidence intervals for the ICCs based on the output I have from the models.

    Thank you again, even if it's just to confirm that I should stick to the complete case analysis.

    Caitlyn

  • #2
    I am not sure that this will work w/ mi estimates, but have you tried using nlcom after running the mixed model? See https://www.statalist.org/forums/for...om-mixed-model

    Comment


    • #3
      Thank you so much, that has worked for the confidence intervals for the ICCs (code below for anyone who needs it).

      Still not sure about the model fit statistics for comparing 2 and 3 level models, do you (or anyone else) have any other suggestions?



      Code for ICCs with confidence intervals after multiple imputation

      mi estimate, or cmdok post: melogit emo_bin || school: || class:
      matrix list e(b)

      *School ICC

      nlcom _b[/:var(_cons[school])] / ((_b[/:var(_cons[school])] + _b[/:var(_cons[school>class])]) + c(pi)^2/3)

      *Class ICC

      nlcom (_b[/:var(_cons[school])] + _b[/:var(_cons[school>class])]) / ((_b[/:var(_cons[school])] + _b[/:var(_cons[school>class])]) + c(pi)^2/3)


      Comment

      Working...
      X