Announcement

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

  • Unknown error message when doing multiple imputation

    Hello,

    I am conducting multiple imputation using the mi chained command with predictive mean matching (pmm). It appears that the imputation is completed, but I am receiving an error message and I am unable to figure out what it means. Here is the error message:

    "Median of S12 invalid name
    stata(): 3598 Stata returned error
    _Imp_chained::destroy(): - function returned error

    S12 is a variable name. Can anyone tell me what the error message means?

    Here is all of my code:

    mi register imputed CBI7re CBI8re CBI9re CBI10re CBI11re CBI12re CBI13rre CBI14re CBI15re CBI16re CBI17re CBI18re CBI19re JS1 JS2 JS3 JS4 JS5 JS6 ST1 ST2 ST4 ST5
    TP1 TP2 TP3 TP4 TP5 PS1 PS2 PS3 PS4 PS5 PS6 PS7 S12_Comb S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 S16 S17 S18 CR1 CR2a CR2b CR2c CR2d CR2e CR2f CR2g;

    mi register regular SanFran Missouri Indiana YrsPosDum0 YrsPosDum1 YrsPosDum2 YrsPosDum3 YrsPosDum4 YrsPosDum5 JobFunAssess JobFunPerm JobFunOther EduBachelors EduMasters EduOther Race3 Gender1;

    mi impute chained (pmm, knn(10)) CBI7re CBI8re CBI9re CBI10re CBI11re CBI12re CBI13rre CBI14re CBI15re CBI16re CBI17re CBI18re CBI19re JS1 JS2 JS3 JS4 JS5 JS6 ST1 ST2 ST4 ST5 TP1 TP2 TP3 TP4 TP5 PS1 PS2 PS3 PS4 PS5 PS6 PS7 S12_Comb S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 S16 S17 S18 CR1 CR2a CR2b CR2c CR2d CR2e CR2f CR2g
    =Missouri Indiana YrsPosDum1 YrsPosDum2 YrsPosDum3 YrsPosDum4 YrsPosDum5 JobFunPerm JobFunOther EduMasters EduOther Race3 Gender1, add(3) burnin(100) rseed(9995) dots force savetrace(T:\JDR_COHA\convergence\chainedTRACE_Sca leItems_5pmm10_pmmONLY, replace);

    Thank you in advance for any guidance you can offer,

    Jon Phillips


  • #2
    Hi Jon

    I've never seen PMM give this error message before and I've used it a lot! Have you run it with the trace on?

    It would be worth trying this using ice (user-written). Because 1) it might work, and 2) the PMM algorithm is superior to the one used by mi impute pmm.

    Tim

    Comment


    • #3
      Seems like something that StataCorp did not foresee. Report this to tech-support.

      Best
      Daniel

      Comment


      • #4
        You will occasionally get these weird errors which, as Daniel says, Stata probably did not foresee and failed to trap. In addition to the above, my main advice would be to make sure your version of Stata is totally up to date (run -update all-). Occasionally you luck out and a bug has already been fixed.

        Also, I would recommend using code tags when posting code and output. See pt. 12 of the FAQ. As it is, what you show is very hard to read. If it were easier to read, we might catch some syntax error which is the real cause of the problem.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://academicweb.nd.edu/~rwilliam/

        Comment


        • #5
          Thank you all for your prompt replies. I tried running the imputation without the savetrace option, and I did not receive the error message. I don't understand why, but that's what happened. I also emailed tech support to let them know what is happening and ask if they have guidance.

          Richard, thank you for letting me know how to properly post my code. I will be sure to use the code tags in the future!

          Comment


          • #6
            Hi Jon

            I ran into a similar error message with -mi impute chained, savetrace()-

            stata(): 3598 Stata returned error
            _Imp_chained::destroy(): - function returned error


            It seems that Stata returns the above error when the name of the trace file contains spaces. As an example, I encountered the error message with code 1 but not code 2:

            Code 1:
            webuse mheart8s0, clear
            mi impute chained (pmm, knn(5) omit(hsgrad)) bmi (regress) age = attack smokes hsgrad female, add(10) savetrace("trace file.dta", replace)


            file trace.dta not found
            stata(): 3598 Stata returned error
            _Imp_chained::destroy(): - function returned error



            Code 2:
            mi impute chained (pmm, knn(5) omit(hsgrad)) bmi (regress) age = attack smokes hsgrad female, add(10) savetrace("trace_file.dta", replace)

            The name of your trace file contains a space in "Sca leItems", could it be the reason for the error message?

            BW, Tra

            Comment

            Working...
            X