Announcement

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

  • command table with option markvar(newvar) creates error __000001 not found

    Why do the commands table and table twoway with the option markvar(newvar)create the error "__000001 not found r(111);"? The error occurs in Stata/MP 18.0 for Windows (64-bit x86-64) and also in Stata/MP 17.0 on the same platform.

    Code:
    . use https://www.stata-press.com/data/r18/nhanes2l, clear
    (Second National Health and Nutrition Examination Survey)
    
    . table sex, markvar(mynewvar)
    
    ---------------------
             |  Frequency
    ---------+-----------
    Sex      |           
      Male   |      4,915
      Female |      5,436
      Total  |     10,351
    ---------------------
    __000001 not found
    r(111);
    
    . noisily table sex diabetes, markvar(mynewvar2)
    
    --------------------------------------------
             |           Diabetes status        
             |  Not diabetic   Diabetic    Total
    ---------+----------------------------------
    Sex      |                                  
      Male   |         4,698        217    4,915
      Female |         5,152        282    5,434
      Total  |         9,850        499   10,349
    --------------------------------------------
    __000001 not found
    r(111);
    
    . tab mynewvar mynewvar2, missing
    
               |       mynewvar2
      mynewvar |         0          1 |     Total
    -----------+----------------------+----------
             1 |         2     10,349 |    10,351 
    -----------+----------------------+----------
         Total |         2     10,349 |    10,351
    The Stata 18 help files say:
    markvar(newvar) generates an indicator variable that identifies the observations used in the tabulation
    .

    Yes, the table and table twoway option markvar(newvar) does what the help files say but why does it also create an error? It is possibly my user error (despite being a long-time user-programmer),

  • #2
    I guess that Jeff Pitblado (StataCorp) may pick this up but in any case I would go straight to StataCorp technical support for this.

    Comment


    • #3
      Here I am.
      Anders found bug in table with option markvar().

      The last line in the modern table code is calling count with the temporary touse variable that was (just prior) renamed to the specified markvar(). We hope to have the fix out to you soon, but in the mean time you can use capture noisily prefix in your do-file to keep Stata from exiting it early; the only thing you are losing here is the scalar result r(N).

      Comment

      Working...
      X