Announcement

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

  • mata object already exists error when using stats() option with estimates tab

    esttab works fine to give me the N but estimates tab won't give me any thing with the stats option
    . estimates tab rncomm, stats(N)
    Mata object __000003 already existsr(110);

    *** esttab can give me the N
    . esttab rncomm

    ----------------------------
    (1)
    rncomm
    ----------------------------
    satjob2_10~t -0.373*
    (-2.23)

    _cons 92.59***
    (224.11)
    ----------------------------
    N 59
    ----------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

    *** estimates tab works fine with no options
    . estimates tab rncomm

    ---------------------------
    Variable | rncomm
    -------------+-------------
    satjob2_10~t | -.37328843
    _cons | 92.594583
    ---------------------------

    *** estimates tab thinks the syntax is fine
    . estimates tab rncomm, stats()

    ---------------------------
    Variable | rncomm
    -------------+-------------
    satjob2_10~t | -.37328843
    _cons | 92.594583
    ---------------------------

    **** Why?
    . estimates tab rncomm, stats(N)
    Mata object __000003 already existsr(110);


    . version
    version 17.0

  • #2
    Welcome to Statalist.

    I am unable to reproduce your problem using an available example dataset on Stata 17.
    Code:
    clear all
    sysuse auto
    quietly regress price weight 
    estimates store gnxl
    esttab gnxl
    estimates tab gnxl
    estimates tab gnxl, stats()
    estimates tab gnxl, stats(N)
    Code:
    . clear all
    
    . sysuse auto
    (1978 automobile data)
    
    . quietly regress price weight 
    
    . estimates store gnxl
    
    . esttab gnxl
    
    ----------------------------
                          (1)   
                        price   
    ----------------------------
    weight              2.044***
                       (5.42)   
    
    _cons              -6.707   
                      (-0.01)   
    ----------------------------
    N                      74   
    ----------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    
    . estimates tab gnxl
    
    ---------------------------
        Variable |    gnxl     
    -------------+-------------
          weight |  2.0440626  
           _cons | -6.7073534  
    ---------------------------
    
    . estimates tab gnxl, stats()
    
    ---------------------------
        Variable |    gnxl     
    -------------+-------------
          weight |  2.0440626  
           _cons | -6.7073534  
    ---------------------------
    
    . estimates tab gnxl, stats(N)
    
    ---------------------------
        Variable |    gnxl     
    -------------+-------------
          weight |  2.0440626  
           _cons | -6.7073534  
    -------------+-------------
               N |         74  
    ---------------------------
    
    .
    You will have noticed that choosing a monospace font is not enough to flog the Statalist Forum software into faithfully reproducing pasted Stata output (the software wants to squeeze out excess spaces). Surrounding output with code delimiters [CODE] and [/CODE] does the trick.

    Comment


    • #3
      It turned out the problem was caused by collect commands run prior to this command. Assume some conflice over mata namespace.

      Comment

      Working...
      X