Announcement

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

  • esttab indicator order creating a coefficient not found error r(111)

    I am using Stata 16.0.

    I am having a very weird error. When I run the following code, I get the error "coefficient bbb_spd not found" with the return code r(111). Note that I have changed the variable names for this.

    Code:
    global GLOB1 "a1 a2 a3 a4 a5"
    global GLOB2 "b1 b2 b3 b4 b5 b6 b7"
    global GLOB3 c8 c2 c3 c5 c9
    global GLOB4 aaa aa a bbb bb b ccc cc_def
    global GLOB5 bbb_spd
    
    reg depVar indic any any_x_indic $GLOB1 $GLOB2 $GLOB3 $GLOB4 $GLOB5
    est store r1
    estadd local cond "All"
    
    reg depVar indic any any_x_indic $GLOB1 $GLOB2 $GLOB3 $GLOB4 $GLOB5 if cond== 1
    est store r2
    estadd local cond "Some"
    
    
    esttab * using `output'/`1'_2.tex, indicate ("First Controls = $GLOB2" ///
     "Second Controls = $GLOB3" "Third Controls = $GLOB4" "Fourth Controls = $GLOB5") ///
     scalars("cond") style(tex) replace
    Note, though, that looking at the output of each of the regressions, the variable bbb_spd does have a coefficient for each of them.

    Yet, when I simply switch the order inside the esttab indicate option, such that the final command reads:

    Code:
    esttab * using `output'/`1'_2.tex, indicate ("First Controls = $GLOB2" ///
     "Second Controls = $GLOB3" "Fourth Controls = $GLOB5" "Third Controls = $GLOB4") ///
     scalars("cond") style(tex) replace
    The code runs perfectly fine. Does anyone have an idea of what could be going wrong? I recognize that "just switch the order" is a solution, but I have this code written in many different locations, so it would be burdensome. Also I am simply curious about the solution.

  • #2
    This is related to a change in how colnumb() and rownumb() work in Stata 16 and the fact that the change has not been put under regular version control. I complained at Stata Corp and the problem will be fixed, but it seems the fix did not yet make it into the last update. You have to wait some more time for the problem to go away.

    In the meantime, a workaround is to type
    Code:
    version 15: esttab ...
    or include
    Code:
    version 15
    at the top of the dofile. If in your dofiles you never use abbreviated variable names, you could also
    Code:
    set varabbrev off
    ben

    Comment


    • #3
      Thank you! That worked perfectly! I have elected for turning off abbreviated variables.

      For anyone reading, the issue was the fact that "bbb" was one of the variables in $GLOB4, so the indicate option in esttab was swallowing up "bbb_spd" as well, leaving no matching variable for the indicate option on $GLOB5.

      Comment


      • #4
        Exactly, thanks for clarifying.

        Comment


        • #5
          The update of Stata 16 released on August 23 should fix the problem.
          ben

          Comment

          Working...
          X