Announcement

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

  • Error after mltcooksd to estimate Cook's D and DFBETAs after xtmixed

    Hello statalist.

    I am trying to estimate Cook's D and DFBETAs after an xtmixed estimation. In order to do so I am using the mltcooksd command, which is a part of the ADO-package mlt. I have tried with different models with and without random slopes and I always get the same error message:

    " Cook's D and DFBETAs cannot be estimated for the level-two unit cntrynum==1
    because the model is not identified without unit. "



    For my xtmixed models I have 44000 observations and 29 groups, with a minimum of 586 observations in the smallest group and a maximum of 2513 observations in the largest group. The variable identifying the level-two units (countries) is cntrynum. The syntax I am using to estimate the models and the Cook's D and DFBETAS is the following:

    Model 1:

    xtmixed vote_rec leg_libdem_no_eu leg_social_justice leg_direct_democracy ib1.chpldm ///
    st_eduyrs st_polintr st_agea gndr wkvlorg leftist unionized1 wrkorg || cntrynum:

    mltcooksd, counter


    Model 2:
    xtmixed protest c.leg_libdem_no_eu c.leg_social_justice##c.union_es c.leg_direct_democracy ib1.chpldm ///
    st_eduyrs st_polintr st_agea gndr unionized1 wkvlorg leftist wrkorg if complete3 == 1 || cntrynum: leg_libdem_no_eu leg_social_justice leg_direct_democracy
    mltcooksd , counter



    The first model does not include any predictor at the country level while the second one does and it also includes a cross-level interaction. In both cases I am getting the same error, which I pasted above.

    Does anyone know how to solve this problem, or any other way to estimate Cook's D and DFBETAs after xtmixed? By the way, I have also tried with the new mixed command but the command mltcooksd does not work with this command.

    Thank you very much for your help.

    Enrique Hernández

  • #2
    Hi Enrique,

    I am receiving the same error message when using the mltcooksd command following an xtmelogit estimation:

    Cook's D and DFBETAs cannot be estimated for the level-two unit countryid==1
    because the model is not identified without unit.
    r(2000);

    I am using Stata 14, but am using the xtmelogit command, since as you noted, mltcooksd does not work with the newer commands such as melogit.

    Were you able to figure out the reason for this error, or another way to estimate the DFBETAs?

    Thank you,
    Jessica Looze


    Comment


    • #3
      Hi Jessica,

      No, unfortunately I have not figured a way to do this in Stata. An apparently none else has any idea about how to solve the problem.

      Best,

      Enrique

      Comment


      • #4
        Did you ever find a solution for this? I am having the same issue and finding only limited documentation.

        Comment


        • #5
          Hi Mara,

          No, unfortunately I have not figured a way to do this in Stata. An apparently none else has any idea about how to solve the problem.

          Best,

          Enrique

          Comment


          • #6
            Hello Enrique.

            I'm working on an exam and ran into the same problem. It looks like the mltcooksd command isn't very fond of categorical and dummy variables. Try seeing if the command runs when you remove those from your model.

            It worked for me, but then I got a new error message that said 'conformability error'. I haven't found some really good information on that error, but it appears to pop up whenever a model is too complex.

            Hope this helps!

            Jonas

            Comment

            Working...
            X