Announcement

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

  • dyndoc with table, statistic() error

    Hello Stata Corp.

    While trying out the new collect and table commands in Stata 17 I discovered a bug. When trying to compile the dyndoc I get the following error:

    option statistic() not allowed
    r(198);
    r(198);

    Here is the content of the md-file:

    Code:
    Testing with tabstat
    
    <<dd_do>>
    clear all
    sysuse auto
    tabstat weight , by(rep78) statistic(mean)
    <</dd_do>>
    
    Testing with table
    
    <<dd_do>>
    table rep78 , statistic(mean weight)
    <</dd_do>>
    
    Done testing
    If I comment out the "table..." command or delete the statistic() option it will run smoothly. I've tried this on two different Stata 17 installations and still get the same error message.

    Regards
    Joakim

  • #2
    This is a bug in dyndoc and will be fixed in the next Stata 17 update. The behavior is caused by dyndoc.ado, dyntext.ado, and markdown.ado using version 16 explicitly. Hence the table command in the <<dd_do>> tag is run under version 16. The fix will make dyndoc.ado, dyntext.ado, and markdown.ado respect the user version the file is run in.

    The work around before the fix is released. Or even the fix is released, if you need finer control of which version of table command to run, you can use version in the dynamic document as in a do-file like the following:

    Code:
    Testing with tabstat
    
    ```
    <<dd_do>>
    clear all
    sysuse auto
    tabstat weight , by(rep78) statistic(mean)
    <</dd_do>>
    ```
    
    Testing with table
    
    <<dd_do: quietly>>
    version 17
    <</dd_do>>
    
    ```
    <<dd_do>>
    table rep78 , statistic(mean weight)
    <</dd_do>>
    ```
    
    Done testing

    Comment


    • #3
      Thank you for the prompt reply!

      Comment

      Working...
      X