Announcement

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

  • spooky 'invalid base specification'

    I'm using -mi estimate- to estimate a mixed effects logit model using -melogit- (with the -cmdok- option); I'm getting an error I have not seen before, and for which I can find no mention anywhere online or in this forum:

    Code:
    invalid base specification
    an error occurred when mi estimate executed melogit on m=1
    no results will be saved
    r(198);
    r(198);
    I assume 'invalid base specification' refers to a factor variable - there are several in the model, but I am not specifying the bases, just using defaults.

    It gets stranger. My code looks like this:
    Code:
    forv t=1/10 {
          mi estimate, cmdok : melogit depvar  i.(xvar_*)  xcont if inlist(subgroup,`t') || id_cluster:
    }
    There's some -display- commands in the loop, nothing else; it runs fine the first 8 times, when it gets to t=9, it exits with the above error. However, if I then type
    Code:
    . mi estimate, cmdok : melogit death i.child i.(xvar_*) PS if inlist(subgroup,9) || id_cluster:
    it runs fine. What gives?


  • #2
    Never mind, I figured it out.

    Comment


    • #3
      I am having the same problem in 2020. How did you fix this?

      Comment


      • #4
        Just before the command that is returning the error message type

        Code:
        set trace on
        then look up in the code for the message in red, copy and paste here about 7 lines before the message in red, and about 3 lines after that, where you use code delimiters to that we can read formatted nicely.

        Originally posted by Sarah Gnib View Post
        I am having the same problem in 2020. How did you fix this?

        Comment


        • #5
          Code:
            --------------------------------------------------------------------------------------------------------------------------- begin u_mi_estimate.mi_cmderr -------------
                    - args cmdname m errok
                    - if ("`errok'"!="") {
                    = if (""!="") {
                      local msg ", ignoring {it:m}=`m'"
                      }
                    - else {
                    - local msg " on {it:m}=`m'"
                    = local msg " on {it:m}=1"
                    - }
                    - di as err "{p 0}"
          - di as err "an error occurred when {bf:mi} {bf:estimate} executed " an error occurred when mi estimate executed - di as err "{bf:`cmdname'}" _c = di as err "{bf:melogit}" _c
          melogit - if ("`m'"!="") { = if ("1"!="") { - di as err `"`msg'"' = di as err `" on {it:m}=1"' on m=1 - } - di as err "{p_end}"
                    ----------------------------------------------------------------------------------------------------------------------------- end u_mi_estimate.mi_cmderr -------------
                  - }
                  - if ("`errok'"=="") {
                  = if (""=="") {
                  - exit `=max(`rc_cmd',`rc_nlcom')'
                  = exit 2000
          Hi Joro, Above is the set trace on results with the results directly above and below when the error occurs. Thank-you for your response!

          Comment

          Working...
          X