Announcement

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

  • invalid numlist r(121);

    Hi all,

    I tried to fix the problem I have with the following syntax:

    mi xeq 1/`M': regress problemuse_CIDI_OH audcscore iatalcohol satalcohol; scalar r2 = r2 + e(r2)

    When I do it on STATA, it says invalid numlist r(121);

    Could you help me to figure out what is the mistake?

    Thank you very much,

    Angeline

  • #2
    Where, when, and how did you define local macro M? The most likely problem is that it is either undefined or is something other than a number at the time you reach your -mi xeq- command. One way to tell which is to place
    Code:
    set tracedepth 1
    set trace on
    just before the -mi xeq- command, and Stata will show you what local macro M contains at that point in time. Then you can work your way back in the code to see why `M' isn't what you expect it to be.

    Comment


    • #3
      Hi Clyde,
      Thank you for your help.
      It did not help me. when I did it.
      I used the procedure indicated in the https://www.stata.com/support/faqs/s...imputed-data/:
      *step 1: to identify where our result of interest is stored

      mi xeq 0: regress problemuse_CIDI_OH audcscore iatalcohol satalcohol

      ereturn list

      *step 2: compute the average of the R2 values
      mi query
      local M = r(M)
      scalar r2 = 0
      mi xeq 1/`M': regress problemuse_CIDI_OH audcscore iatalcohol satalcohol; scalar r2 = r2 + e(r2)
      set tracedepth 1
      set trace on
      mi xeq 1/`M': regress problemuse_CIDI_OH audcscore iatalcohol satalcohol; scalar r2 = r2 + e(r2)
      Then it indicate again the same information:
      r(121);invalid numlist.


      Comment


      • #4
        Put

        Code:
        display "`M'"
        just before your mi xeq command so that we can see what is inside (if anything).

        Comment


        • #5
          the help for -mi query- says that r(M) is only what you want if your data is NOT flongsep and r(m) is what you want if your data are flongsep - so, what are your data; also, insert a
          Code:
          mac li _M
          right after you define "local M" to see what the value actually is and whether it is correct

          Comment


          • #6
            Just to be clear, my suggestion about -set tracedepth1- and -set trace on- was not intended to make the -mi xeq- command run without error: it was intended to show you what is in local macro M. Only when we know that can we figure out how to fix things. Nick Cox and Rich Goldstein have shown you two other ways to find out what is in local macro M. Either of those will work just as well as the approach using -trace-. The point is that you have to find out what is in local macro M at the time you reach the -mi xeq- command. In addition, Rich Goldstein has offered a plausible hypothesis for why the contents of local macro M may be wrong: having used r(M) where r(m) is needed. You should pursue that possibility.

            Comment


            • #7
              Hi all,
              Thank you for helping me. When I use set tracedepth 1, or other ways purposed by Rich or Nick, it appears nothing.

              My guess is that the matrix is empty as you suggested.. I set the format in wide format. When I use m instead of M. Is still give me the same error information and the matrix looks still empty.
              What do you think?

              Comment

              Working...
              X