Announcement

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

  • error while using -tabplot- options percent/fraction

    I am using a freshly installed version of -tabplot- from StataJournal (*! 2.8.0 NJC 2 July 2019) which the latest Stata 17. The error occurs when I use the options percent or fraction (see below).

    The error message is
    option 0 not allowed
    and it occurs in this chunk of code:
    ------------------------------------ begin _fr_tbstyle_parse_and_log ---
    - gettoken log 0 : 0
    - gettoken prefix 0 : 0
    - gettoken stylenm 0 : 0
    - syntax [ , TSTYle(string) ANGLE(string) Size(string) Color(string) Jus
    > tification(string) Alignment(string) Margin(string) LINEGAP(string) NOBox Box BMargin(string
    > ) PLACEment(string) BFColor(string) FColor(string) BColor(string) BLSTyle(string) BLWidth(st
    > ring) BLColor(string) BLPattern(string) BLAlign(string) LSTyle(string) LWidth(string) LColor
    > (string) LPattern(string) LAlign(string) ORIENTation(string) * ]
    - local style_eds `"`tstyle'"'
    = local style_eds `""'
    - local line_eds `"`blstyle'"'
    = local line_eds `""'
    - if `"`lstyle'"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `lstyle'"'
    }
    - if `"`justification'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' horizontal(`justification')"'
    }
    - if `"`alignment'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' vertical(`alignment')"'
    }
    - if `"`box'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' drawbox(yes)"'
    }
    - else {
    - if `"`nobox'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' drawbox(no)"'
    }
    - }
    - if `"`placement'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' box_alignment(`placement')"'
    }
    - if `"`bcolor'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' fillcolor(`bcolor')"'
    local line_eds `"`line_eds' color(`bcolor')"'
    }
    - if `"`bfcolor'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' fillcolor(`bfcolor')"'
    }
    - if `"`fcolor'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' fillcolor(`fcolor')"'
    }
    - if `"`bmargin'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' boxmargin(`bmargin')"'
    }
    - foreach opt in angle size color margin linegap {
    - if `"``opt''"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' `opt'(``opt'')"'
    }
    - }
    - if `"``opt''"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' `opt'(``opt'')"'
    }
    - }
    - if `"``opt''"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' `opt'(``opt'')"'
    }
    - }
    - if `"``opt''"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' `opt'(``opt'')"'
    }
    - }
    - if `"``opt''"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' `opt'(``opt'')"'
    }
    - }
    - foreach opt in width color pattern align {
    - if `"`bl`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`bl`opt'')"'
    }
    - if `"`l`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`l`opt'')"'
    }
    - }
    - if `"`bl`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`bl`opt'')"'
    }
    - if `"`l`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`l`opt'')"'
    }
    - }
    - if `"`bl`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`bl`opt'')"'
    }
    - if `"`l`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`l`opt'')"'
    }
    - }
    - if `"`bl`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`bl`opt'')"'
    }
    - if `"`l`opt''"' != `""' {
    = if `""' != `""' {
    local line_eds `"`line_eds' `opt'(`l`opt'')"'
    }
    - }
    - if `"`line_eds'"' != `""' {
    = if `""' != `""' {
    local style_eds `"`style_eds' linestyle(`line_eds')"'
    }
    - if `"`style_eds'"' != `""' {
    = if `""' != `""' {
    if "`stylenm'" != "" {
    local style_eds `"`stylenm'(`style_eds')"'
    }
    .`log'.Arrpush .`prefix'.editstyle `style_eds' editcopy
    }
    - return local rest `"`options'"'
    = return local rest `"0"'
    -------------------------------------- end _fr_tbstyle_parse_and_log ---
    - return local rest `"`r(rest)'"'
    = return local rest `"0"'
    ---------------------------------------- end _fr_textbox_parse_and_log ---
    - return local rest `r(rest)'
    = return local rest 0
    ---------------------------------------- end _fr_sztextbox_parse_and_log ---
    - local 0 `", `r(rest)'"'
    = local 0 `", 0"'
    - }
    - syntax [, FAKE_OPT_FOR_BETTER_MSG ]
    option 0 not allowed
    }
    ---------------------------------------------- end _fr_title_parse_and_log
    The code to reproduce is:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    cwf default
    cap frame drop tabp
    frame create tabp
    cwf tabp
    clear
    input byte(inst fg) double summe
    11  3 125300
    11  3 111300
    11  3  60100
    11  3  68400
    11  3  73900
    11  3  43300
    11  3 941000
    11  3  68300
    11  3  64200
    11 .i  28800
    11  3  26500
    11  3 136900
    11  3   3500
    11  3  85700
    11  3  45600
    11  4 136900
    11  3  18100
    11  3  66900
    11  3  75400
    11  3  71500
    11  3 136900
    11  3  88800
    11  3 136900
    11  3 131400
    11  3 136900
    11  3  73500
    11  3  43200
    11  3  36000
    11  3  10400
    11  3  84700
    11  3 142400
    11  3  35200
    11  3  13000
    11  3  68400
    11  4  67000
    11  3  34200
    11  3  29800
    11  4  68800
    11  3  68400
    11  3 142400
    11  3  34200
    11 .i  57600
    11  3  66500
    11  4  51300
    11  4  67000
    11  3  66300
    11  3  44300
    11  4  67200
    11  3  28400
    11  3 136900
    11  4  98800
    11  4 110300
    11  3  46700
    11  3 136900
    11  3  21100
    11  3 103500
    11  3  12000
    11  3  41700
    11  3 259500
    11  3  74500
    11  4   6100
    11  3  68400
    11  3  71300
    11  3  68400
    11  3 108500
    11  4  72600
    11  3 153200
    11  4  13300
    11  3  10300
    11  3  69400
    11  3 144300
    11  3 364600
    11  3 118600
    11  3  66300
    11  3 110200
    11  4  28600
    11  3 111300
    11  4  38900
    11  3  61200
    11  3  71300
    11  3  42700
    11  3  71200
    11  4  38900
    11  3  34700
    11 .i  68900
    11  3  69400
    11  3 138800
    11  3 144300
    11 .i 101000
    11  4  69800
    11  3  41100
    11  3 138800
    11  4 138800
    11  3  76400
    11  3  69400
    11  3 138800
    11  3  60100
    11  3  69400
    11  3  72700
    11  3  53400
    11  3  33900
    11 .i 110400
    11  3  10400
    11  4  68400
    11  3 182800
    11  3  69400
    11  3 138800
    11  4  33600
    11  3  67300
    11  4  56600
    11  3  80700
    11  3  75500
    11  3  34700
    11  4 130700
    11  4  32400
    11  4  16400
    11 .i  66800
    11  3  21100
    11  3 387900
    11  3  60900
    11  3 138800
    11  3 138800
    11  3  68900
    11  3  71500
    11  3  77100
    11  3  32000
    11  3 141800
    11  3  35400
    11  3  33000
    11  3 110200
    11  3  35400
    11 .i  68900
    11 .i 110400
    11  3  70900
    11  3  70900
    11  4 141800
    11  4  66700
    11  3  50800
    11  3 171500
    11  4  72600
    11  3 247000
    11  3 141800
    11  3  63700
    11  3  76400
    11  3  70200
    11  4  56600
    11  3  92700
    11  3  23400
    11  3 141800
    11 .i 113900
    11  3  71200
    11  3 108500
    11  3  51600
    11  3  71200
    11  3  84700
    11  3  77000
    11  3 141800
    11  3 141800
    11  3  70900
    11  3  35400
    11  3  70900
    11  4  65300
    11  4  53100
    11  3  12000
    11  3   6700
    11  3  77900
    11  3  62800
    11 .i 101000
    11  3  66200
    11  3 147300
    11  4 130700
    11  3 141800
    11  3  70900
    11  3 333200
    11  3 153200
    11  3  24800
    11  3  65800
    11  3  61200
    11  4 113500
    11  3 107100
    11  3    800
    11  3  28400
    11  3  43900
    11  3 108800
    12  3 464900
    12  5  68700
    12  5  59200
    12  5  66100
    12  5  15100
    12  5  65500
    12  4 135700
    12  3  50100
    12  5   5400
    12  5  66500
    12  3 136900
    12  3 109100
    12  5 127300
    12  5 150000
    12  3 136900
    12  6  58600
    12  5  52700
    12  5  88400
    12  5 113800
    12  3  75400
    12  3 103500
    12  5  69900
    12  5 113800
    12  3  68900
    12  5 139600
    12  5 191800
    12  3 368400
    12  5  68700
    12  5  63700
    12  5  57600
    12  3  55400
    12  3 138800
    12  3  73700
    12  4 135700
    12  5  57200
    12  3 110900
    12  3  51100
    12  5  32500
    12  5   5600
    12  3 138800
    12  5  67900
    12  5 150000
    12  3  76400
    12  5  88400
    12  5  28200
    12  5  69900
    12  3 113500
    12  3   6000
    12  5  56100
    12  5  34600
    12  5  57600
    12  3  79000
    12  5  75900
    12  5  85100
    12  3  75400
    12  5 137300
    12  5  72600
    12  3  77900
    12  4  98200
    12  5  34000
    12  3 141800
    12  5  63700
    12  5  67900
    12  5 220900
    12  5 142500
    12  3  52600
    12  3  55400
    12  3 141800
    12  3 504500
    12  5  63400
    12  5  74700
    13  8  87900
    13  8  42100
    13  8   6400
    13  8  23600
    13  4  82100
    13  8  59100
    13  3  82000
    13  8 100600
    13  3  82000
    13  8 176900
    13  8  87900
    13  3  83600
    13  3  84300
    13  3  84300
    13  3  83600
    13  8 117700
    13  8 100600
    14  7  40700
    14  7  11000
    14  7  64000
    14  7  40800
    14  7  65900
    14  7  64000
    14  7 165500
    14  7   5500
    14  7  14600
    14  7  10000
    14  7  65900
    14  7  29100
    14  7  39100
    14  7 326100
    14  7  58600
    14  7  65400
    15  3  28200
    15  4  68200
    15  3  87000
    15  4  73100
    15  4 929500
    15  3  64500
    15  3 100300
    15  3 102200
    15  3  40000
    15  5  30500
    15  4  68200
    15  4 965700
    15  3  55900
    15  4  73100
    15  3  87000
    15  4  12200
    15  4  12500
    15  3  55900
    15  4 973000
    15  3  87000
    15 .i  69300
    15  4  74900
    15  3 105200
    15  5  72800
    15  4  22400
    15  4   2000
    15  4  73000
    15  4  24000
    15  3  40600
    16  6  57900
    16 .i  49600
    16  6  74700
    16  6  64000
    16  6  60800
    16  6  50100
    16  6  60400
    16 .i  48100
    16  6  48900
    16  6 103500
    16  6  52800
    16 .i  49600
    16  6  62400
    16 .i 100700
    16  6  60300
    16  6   7500
    16  6  72600
    16  6 164700
    16  6  65700
    16  6   4900
    16  6  53600
    16  6   3500
    16  6  72900
    16 .i 100700
    16  6   3700
    16  4  21100
    16  6 103500
    16 .i  78600
    16  6  66500
    16  6  64400
    16  6  89000
    16  6  35000
    16  6  64000
    16  6  64000
    16  6  40700
    16  6  61600
    16  6  43400
    16  6 164700
    16  6  63000
    16  6  49100
    16  6  66400
    16  6  73700
    16 .i  63000
    16 .i  70400
    16  6  59000
    16  6   5800
    16  6 109100
    16  6 131800
    16  6  42600
    16  6  75300
    16  6  73500
    16  6   3700
    16  6  66100
    16  4  31500
    16  6  60100
    16 .i  63000
    16  6  91900
    16  6  63600
    16  6  65200
    16  6  60600
    16  6  89000
    16  6  66500
    16  6 164700
    16  6   5800
    16  6  72900
    16  6  64000
    16  6  64400
    16  6  63000
    16 .i  78600
    16 .i  70400
    17  4  94100
    17  2  15800
    17  2  42500
    17  2  56400
    17  2   8500
    17  2 105000
    17  2  61600
    17  2 110900
    17  2  53500
    17  4  26700
    17  4  95900
    17  2 105400
    17  2  95000
    17  2  10000
    17  2 110800
    17  2  51600
    17  2   5800
    17  2  96100
    17  4  87200
    17  4  50600
    17  2   6300
    17  2 117700
    17  2   6100
    17  2  68900
    17  2 132200
    17  2   1400
    17  4  46500
    17  2 105400
    17  2  79100
    17  2 117300
    37  4 144600
    37  3 123700
    37  4 173500
    37  4  66700
    37  3  74900
    37  4 138400
    37  4 106000
    37  4 128900
    37  4  24400
    37  4  42500
    37  5  44400
    37  4  13400
    37  3  68400
    37  4  47000
    37  4  80400
    37  4  67700
    37  4 104200
    37  1  13700
    37  4 105700
    37  4  77500
    37  4  40500
    37  4  77400
    37  4  46900
    37  3  71900
    37  3 136900
    37  4  78300
    37  4 111100
    37  4  77050
    37  4  68400
    37  4  38700
    37  4 175200
    37  4  31800
    37  3  12200
    37  4  42500
    37  4  90600
    37  4  32100
    37  4  77050
    37  4 123000
    37  4  17500
    37  4  65900
    37  4  83700
    37  4  75500
    37  4  73300
    37  4 134400
    37  4  41500
    37  4 106100
    37  4  65700
    37  4  51200
    37  2  18800
    37  4  15100
    37  4  51200
    37  4 108300
    37  4  65700
    37  4  87300
    37  4  68400
    37  4 589600
    37  4  27400
    37  4  92700
    37  4  90600
    37  3  62300
    37  4 813100
    37  4 114500
    37  2  57400
    37  4  78300
    37  4  63100
    37  4  65900
    37  4  86500
    37  4  70900
    37  4  87300
    37  4  73000
    37  4  25300
    37  4 144900
    37  4  19700
    37  4 112900
    37  4  76525
    37  2  14100
    37  4 105200
    37  4  79700
    37  4  66700
    37  3  69400
    37  4 602600
    37  4  52100
    37  4 112900
    37  4 114500
    37  4 176400
    37  4  15900
    37  4 112100
    37  3  57000
    37  4  56300
    37  4  67700
    37  4  15000
    37  3  75900
    37  4  77400
    37  4  69400
    37  4  30900
    37  4  86900
    37  4  37800
    37  2  68400
    37  2  42900
    37  4  20100
    37  4  41500
    37  4  76525
    37  4 175200
    37  4  20300
    37  4  30400
    37  4 144900
    37  4  49700
    37  4  66900
    37  4  16900
    37  4  16000
    37  4  79700
    37  4  99000
    37  5  66200
    37  4 107800
    37  4  77500
    37  4 107900
    37  4  24700
    37  4  20900
    37  4  69400
    37  4 111100
    37  3 122700
    37  4  71900
    37  4 112500
    37  4 107500
    37  4  42900
    37  4  52100
    37  4  86500
    37  4 130100
    37  4 926700
    37  4  66700
    37  4 117800
    37  4  86900
    37  4 104400
    37  4 146500
    37  3 123700
    37  4 110600
    37  3 141300
    37  4 108900
    37  4  73300
    37  4  22300
    37  1  63800
    37  4  17400
    37  4  83700
    37  4  76525
    37  3 105900
    37  4  42900
    37  4  73000
    37  3  73300
    37  4  75500
    37  4  99400
    37  4  79300
    37  4 138800
    37  4  82200
    37  4 101600
    37  4  66900
    37  4  83900
    37  4  91200
    37  3  34800
    37  4  56300
    37  4  12200
    37  4  25400
    37  4   7800
    37  4 108200
    37  3  61300
    37  4  70900
    37  3 101200
    37  2  60500
    37  3 122700
    37  4 202200
    37  4  28400
    37  4  80200
    37  4 105200
    37  4  11800
    37  4 414300
    37  4 149600
    37  4  72600
    37  2  20200
    37  4  85600
    37  2  36600
    37  4  27800
    37  4  79800
    37  2   6600
    37  4 180800
    37  4  77100
    37  4  99400
    37  2  28400
    37  4 115100
    37  4  52600
    37  4  92000
    37  4  13900
    37  4 936100
    37  4  22200
    37  4  66400
    37  4 116800
    37  4  65800
    37  4 117800
    37  4  92000
    37  3  77300
    37  4 115200
    37  4 112100
    37  4  60200
    37  4  77700
    37  4  16000
    37  5  66200
    37  4 101600
    37  4  56300
    37  4  77100
    37  4 122200
    37  4  76600
    37  4  20800
    37  4  60900
    37  4  70900
    37  4  73700
    37  4  83900
    37  4  59600
    37  4  72600
    37  4 141800
    37  4 111500
    37  4 151100
    37  3  70900
    37  4  76600
    37  4 535600
    37  4  11800
    37  2  68400
    37  4  92500
    37  3 144200
    37  4  44000
    37  4  52600
    37  3  73300
    37  4  92500
    37  4  83000
    37  4  44000
    37  4 173600
    37  4 235200
    37  4 110600
    37  4  91200
    37  1  63800
    37  4 118700
    37  4  77100
    37  4  45300
    37  4  77500
    37  4  66400
    37  4  73300
    37  4  69400
    37  4 115100
    43  4 129400
    43  4   9600
    43  3  69800
    43  4  77900
    43  4  43300
    43  4  67200
    43  4  42000
    43  4  67200
    43  4  65400
    43  4  72200
    43  3  34000
    43  4 110300
    43  4 314100
    43  4  64100
    43  4 171400
    43  4  21200
    43  3 357300
    43  4  22100
    43  4  32100
    43  4 142200
    43  4  90600
    43  4  67200
    43  4 120400
    43  4 106000
    43  4  94700
    43  4  23800
    43  4   6000
    43  3  52600
    43  4  88400
    43  4 133200
    43  4 115400
    43  4  45000
    43  4  60600
    43  4  84400
    43  4  25300
    43  4 139900
    43  4  13600
    43  4 329400
    43  4 113900
    43  3  61300
    43  4 133900
    43  4  37000
    43  4  73300
    43  4  64100
    43  4   4900
    43  3  64500
    43  4  41700
    43  4  89100
    43  3  54600
    43  8  49400
    43  4 142600
    43  4 106400
    43  3  12100
    43  4  94700
    43  4 131500
    43  4 112100
    43  4 174300
    43  3  80400
    43  4 556400
    43  4  38000
    43  4  34900
    43  3  40000
    43  4  94700
    43  4 141900
    43  4  68400
    43  4  68800
    43  4  88200
    43  4  57100
    43  4  77800
    43  4  88200
    43  4 144900
    43  4  73300
    43  4  25300
    43  4  66300
    43  4  21200
    43  4  65100
    43  4  70700
    43  4  59700
    43  4  71400
    43  4  72200
    43  4  76600
    43  4  73100
    43  4 110300
    43  4  63100
    43  3  69800
    43  3  11100
    43  4  76525
    43  4   6600
    43  4 314100
    43  4  57500
    43  3 108400
    43  4  68800
    43  3  67600
    43  3  56100
    43  4 115800
    43  4  42100
    43  4  34800
    43  4  48400
    43  4 115400
    43  3 168200
    43  4  65100
    43  4  24100
    43  4  86900
    43  3 170800
    43  4  19900
    43  4 134400
    43  4  16800
    43  4 115400
    43  4 413700
    43  4 148500
    43  3  28900
    43  4  72600
    43  4  47300
    43  4  62700
    43  4  60800
    43  3  67600
    43  4  48100
    43  4 178700
    43  4  70900
    43  4  77100
    43  4  32400
    43  4  86300
    43  3 108400
    43  4  70200
    43  4  70700
    43  4  29900
    43  4 118300
    43  4  81900
    43  4  69400
    43  4  77700
    43  4  70200
    43  3  80400
    43  4 154700
    43  4  17500
    43  4  71400
    43  4  73400
    43  4 144800
    43  4  77900
    43  4  71200
    43  4  75800
    43  4  90200
    43  3  40600
    43  4  71200
    43  4  80000
    43  4  68400
    43  4 112100
    43  4  64900
    43  4  19400
    43  4  90200
    43  4  26100
    43  4 148600
    43  4  34300
    43  4  67800
    43  4 118400
    43  4  34300
    end
    label values inst inst
    label def inst 11 "WE B", modify
    label def inst 12 "WE C", modify
    label def inst 13 "WE I", modify
    label def inst 14 "WE M", modify
    label def inst 15 "WE P", modify
    label def inst 16 "WE P", modify
    label def inst 17 "WE P", modify
    label def inst 37 "Inst", modify
    label def inst 43 "Kli", modify
    label values fg l_fg
    label def l_fg 1 "Gei", modify
    label def l_fg 2 "Soz", modify
    label def l_fg 3 "Bi", modify
    label def l_fg 4 "Me", modify
    label def l_fg 5 "Ch", modify
    label def l_fg 6 "Ph", modify
    label def l_fg 7 "Ma", modify
    label def l_fg 8 "In", modify
    label def l_fg .i "irr", modify
    
    tabplot inst fg [fw=summe], ///
                note("") missing percent separate(inst)

  • #2
    In addition the code used in my former post does work. see https://www.statalist.org/forums/for...13#post1599213
    Code:
    sysuse auto, clear
    split make, parse(" ")
    encode make1, gen(brand)
    contract brand foreign rep78, zero
    gen double _freq2 = cond(_freq == 0, 1e-9, _freq)
    tabplot brand rep78 if foreign == 0 [iw=_freq2], percent(brand) min(1) separate(rep78) showval(,mlabs(vsmall) ) name(f0, replace) xasis
    
    clonevar fa = _freq
    replace fa = 1 if brand == 2 & foreign==0 & inlist(rep78,4)
    replace fa = 5 if brand == 2 & foreign==0 & inlist(rep78,2,3,5)
    replace fa = 1 if brand == 2 & foreign==1 & rep78==4
    replace fa = 6 if brand == 3 & foreign==0 & inlist(rep78,2,3,5)
    replace fa = 1 if brand == 3 & foreign==0 & inlist(rep78,4)
    replace fa = 8 if brand == 3 & foreign==1 & inlist(rep78,2,3,5)
    replace fa = 2 if brand == 9 & foreign==0 & inlist(rep78,2,3)
    replace fa = 10 if brand == 9 & foreign==1 & rep78==2
    
    gen double fa2 = cond(fa == 0, 1e-9, fa)
    
    tabplot brand rep78 [iw=fa2], by(foreign) percent(brand) min(1) separate(rep78) showval(,mlabs(vsmall) ) name(f1, replace) xasis height(0.6)

    Comment


    • #3
      #1 That code runs for me without a problem.

      Comment


      • #4
        Strange I tested it with two computers at work and both setups create the error.
        I'll test it at home tonight on another two computers...
        Last edited by Marc Kaulisch; 01 Apr 2022, 04:52.

        Comment


        • #5
          I am lost - my first try at home gives me:
          Attached Files

          Comment


          • #6
            Originally posted by Nick Cox View Post
            #1 That code runs for me without a problem.
            I have tried it now with four different Stata installations. I get every time the same error.

            Comment


            • #7
              Not so; you get different errors. Option 0 and option 6 are being objected to variously.

              Again, I get a graph fine with your data example, your code and this set-up.

              Code:
              . about
              
              Stata/MP 17.0 for Windows (64-bit x86-64)
              Revision 15 Feb 2022
              Copyright 1985-2021 StataCorp LLC
              
              Total physical memory:        8.00 GB
              Available physical memory:    0.92 GB
              
              Stata license: Single-user 4-core  perpetual
              <personal details> 
              
              . which tabplot
              C:\Users\Laptop\ado\plus\t\tabplot.ado
              *! 2.8.0 NJC 2 July 2019
              The error is deep inside official Stata code for frames -- not tabplot as such. Still, I have no idea why it is biting you and not me.

              Comment


              • #8
                Originally posted by Nick Cox View Post
                The error is deep inside official Stata code for frames -- not tabplot as such. Still, I have no idea why it is biting you and not me.
                Thank you very much for your investigation. I'll ping StataTech Support.

                My home computer is
                Code:
                . about
                
                Stata/MP 17.0 for Windows (64-bit x86-64)
                Revision 15 Feb 2022
                Copyright 1985-2021 StataCorp LLC
                
                Total physical memory:       64.00 GB
                Available physical memory:   52.42 GB
                
                Stata license: Single-user 2-core , expiring 31 Aug 2022
                <personal details>
                
                . which tabplot
                c:\ado\plus\t\tabplot.ado
                *! 2.8.0 NJC 2 July 2019

                Comment


                • #9
                  Originally posted by Nick Cox View Post
                  #1 That code runs for me without a problem.
                  Dear Nick Cox , may you try to run the code with - set dp comma-.
                  When I switch to -set dp period- my code works. After I got feedback from Stata Tech Support. I have looked again at the traced code and I wondered about "28,6".

                  So I get
                  Code:
                   else local BIGGEST = `biggest'
                    = else local BIGGEST = 28.60935357307442
                  (...)
                   - if "`percent'`percent2'" != "" local format %2.1f
                    = if "percent2" != "" local format %2.1f
                    - else if "`fraction'`fraction2'" != "" local format %4.3f
                    = else if "" != "" local format %4.3f
                    - else if "`pm'`pm2'" != "" local format %3.0f
                    = else if "" != "" local format %3.0f
                    - local biggest = trim("`: di `format' `biggest''")
                    = local biggest = trim("28,6")
                    - if "`frame'" != "" local note "note(`text': `biggest'; frame: `frame')"
                    = if "" != "" local note "note(maximum: 28,6; frame: )"
                    - else local note "note(`text': `biggest')"
                    = else local note "note(maximum: 28,6)"
                    - }
                    - if `"`by'"' == "" {
                    = if `""' == "" {
                    - local notwithby "subtitle(`what', place(w) size(medsmall)) legend(off) `note'"
                    = local notwithby "subtitle(percent, place(w) size(medsmall)) legend(off) note(maximum: 28,6)"
                  This 28,6 somehow seems to lead to:
                  Code:
                   = while `"maximum: 28,6"' != `""' {
                                  - local rest `"`options'"'
                                  = local rest `"subtitle(percent, place(w) size(medsmall))"'
                                  - _parse comma curlines 0 : `ttype'
                                  = _parse comma curlines 0 : note
                                  - syntax [ , NOSPAN SPAN PREFIX SUFFIX POSition(string) RING(string) STYle(string) * ]
                                  - if `"`curlines'"' != `""' {
                                  = if `"maximum: 28"' != `""' {
                                  - if "`suffix'" != "" {
                                  = if "" != "" {
                                    local lines `"`lines' `curlines'"'
                                    if "`prefix'" != "" {
                                    di as text "option prefix ignored, " "may not be combined with suffix"
                                    }
                                    }
                                  - else {
                                  - if "`prefix'" != "" {
                                  = if "" != "" {
                                    local lines `"`curlines' `lines'"'
                                    }
                                  - else {
                                  - local lines `"`curlines'"'
                                  = local lines `"maximum: 28"'
                                  - }
                                
                                  - local uoptions `uoptions' (`options')
                                  = local uoptions  (6)
                  (...)
                   - while `++i' < 20 & `"`uoptions'"' != `""' {
                                  = while 1 < 20 & `"(6)"' != `""' {
                  And here it comes the "option 6 not allowed" error message.

                  Comparing the two traced outcomes the issue is becoming obvious:
                  Click image for larger version

Name:	2022-04-08_tabplot_try_periodcomma.png
Views:	1
Size:	53.8 KB
ID:	1658743

                  Last edited by Marc Kaulisch; 08 Apr 2022, 15:38.

                  Comment


                  • #10
                    That's very helpful. The bug is in tabplot that when
                    Code:
                    set dp comma
                    is on the comma in numbers like 1,2 or 3,4 will be misinterpreted as an option switch within note(). As Marc Kaulisch hints, different numbers will trigger different error messages.

                    I was wrong in #2 to point to the frames commands: the original error comes from deep inside graph.

                    Marc's original example can be trimmed down to this:

                    Code:
                    set scheme s1color 
                    set dp comma 
                    cwf default
                    cap frame drop tabp
                    frame create tabp
                    cwf tabp
                    clear
                    * Example generated by -dataex-. For more info, type help dataex
                    clear
                    input byte(inst fg) double summe
                    11  3 13094600
                    11  4  2112700
                    11 .i   827700
                    12  3  3407100
                    12  4   369600
                    12  5  3269800
                    12  6    58600
                    13  3   499800
                    13  4    82100
                    13  8   802800
                    14  7  1066200
                    15  3   853800
                    15  4  3371800
                    15  5   103300
                    15 .i    69300
                    16  4    52600
                    16  6  3692500
                    16 .i   772700
                    17  2  1563300
                    17  4   401000
                    37  1   141300
                    37  2   422300
                    37  3  2005200
                    37  4 20424475
                    37  5   176800
                    43  3  1804500
                    43  4 11565325
                    43  8    49400
                    end
                    label values inst inst
                    label def inst 11 "WE B", modify
                    label def inst 12 "WE C", modify
                    label def inst 13 "WE I", modify
                    label def inst 14 "WE M", modify
                    label def inst 15 "WE P", modify
                    label def inst 16 "WE P", modify
                    label def inst 17 "WE P", modify
                    label def inst 37 "Inst", modify
                    label def inst 43 "Kli", modify
                    label values fg l_fg
                    label def l_fg 1 "Gei", modify
                    label def l_fg 2 "Soz", modify
                    label def l_fg 3 "Bi", modify
                    label def l_fg 4 "Me", modify
                    label def l_fg 5 "Ch", modify
                    label def l_fg 6 "Ph", modify
                    label def l_fg 7 "Ma", modify
                    label def l_fg 8 "In", modify
                    label def l_fg .i "irr", modify
                    
                    tabplot inst fg [fw=summe], ///
                                note("") missing percent separate(inst)
                    I've fixed the error in my version of the code. I will send the code to Marc for further testing. Marc: Please send a personal message with email address to get the latest version of the code.

                    Comment


                    • #11
                      This bug is now fixed, I hope. Thanks again to Marc Kaulisch for the report. Posting of a revised version will be made in another thread.

                      Comment

                      Working...
                      X