Announcement

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

  • Error Code r(4026) rvalue invalid

    Hi,

    I keep getting an error code return of r(4026) rvalue invalid when trying to run certain graphs and then eventually once this error code returns it won't run any graphs. I have ensured all the variables exist in their correct numerical format but I can't figure out the source of the error.
    Here's the line of code that works
    "graph bar arcsinsqrt_nmolcomp if dsample==14 & set==6, over(tissueid, label(angle(45))) over(AA) bar(1, color(black)) ylabel(0.0 0.1 0.2 0.3 0.4,nogrid) subtitle("E. Ring", position(11)) name(ring, replace)"
    Then when I run this code, it returns r(4026) and prevents me from running other graphing code after
    "graph bar arcsinsqrt_nmolcomp if dsample==14 & set==7, over(tissueid, label(angle(45))) over(AA) bar(1, color(black)) ylabel(0.0 0.1 0.2 0.3 0.4,nogrid) subtitle("F. Sulfur", position(11)) name(sulf, replace)"

  • #2
    That sounds quite deep. Can you show the results of

    Code:
    dataex arcsinsqrt_nmolcomp tissueid AA if dsample == 14 & set == 6
    or of any data example that reproduces the problem.

    Comment


    • #3
      Thanks so much for a quick response!
      Here are the results from that code:

      * Example generated by -dataex-. For more info, type help dataex
      clear
      input float(arcsinsqrt_nmolcomp tissueid AA)
      .21488947 3 13
      .1858575 3 14
      .23682536 4 13
      .17037845 4 14
      .25023624 2 13
      .15159355 2 14
      .22296304 3 13
      .18658005 3 14
      .2406212 4 13
      .15928502 4 14
      .26347938 2 13
      .1476002 2 14
      .2295701 3 13
      .19402744 3 14
      .24213037 4 13
      .1566094 4 14
      .26160935 2 13
      .14679553 2 14
      .2176669 3 13
      .1969044 3 14
      .2549964 4 13
      .16342042 4 14
      .25767484 2 13
      .15269837 2 14
      .22346798 3 13
      .1938838 3 14
      .2400915 4 13
      .1650164 4 14
      .26291433 2 13
      .1539713 2 14
      .21507324 3 13
      .18630375 3 14
      .25065064 4 13
      .16013385 4 14
      .25534075 2 13
      .1481193 2 14
      .21933874 3 13
      .1940244 3 14
      .2521977 4 13
      .15805417 4 14
      .25127363 2 13
      .154479 2 14
      .2210701 3 13
      .1878065 3 14
      .25184953 4 13
      .15131025 4 14
      .25782618 2 13
      .14335221 2 14
      .21836656 3 13
      .1708736 3 14
      .24286278 4 13
      .16052626 4 14
      .25790977 2 13
      .14366569 2 14
      end
      label values tissueid tissueid
      label def tissueid 2 "rbc", modify
      label def tissueid 3 "serum", modify
      label def tissueid 4 "buffycoat", modify
      label values AA AA
      label def AA 13 "PHE", modify
      label def AA 14 "TYR", modify

      Comment


      • #4
        Perhaps I should be asking for the selection

        Code:
        if dsample==14 & set==7

        Comment


        • #5
          Interesting, it seems running the bar command twice trigger the error, the following is a reproducible example base on the data.

          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          input float(arcsinsqrt_nmolcomp tissueid AA)
          .21488947 3 13
          .1858575 3 14
          .23682536 4 13
          .17037845 4 14
          .25023624 2 13
          .15159355 2 14
          .22296304 3 13
          .18658005 3 14
          .2406212 4 13
          .15928502 4 14
          .26347938 2 13
          .1476002 2 14
          .2295701 3 13
          .19402744 3 14
          .24213037 4 13
          .1566094 4 14
          .26160935 2 13
          .14679553 2 14
          .2176669 3 13
          .1969044 3 14
          .2549964 4 13
          .16342042 4 14
          .25767484 2 13
          .15269837 2 14
          .22346798 3 13
          .1938838 3 14
          .2400915 4 13
          .1650164 4 14
          .26291433 2 13
          .1539713 2 14
          .21507324 3 13
          .18630375 3 14
          .25065064 4 13
          .16013385 4 14
          .25534075 2 13
          .1481193 2 14
          .21933874 3 13
          .1940244 3 14
          .2521977 4 13
          .15805417 4 14
          .25127363 2 13
          .154479 2 14
          .2210701 3 13
          .1878065 3 14
          .25184953 4 13
          .15131025 4 14
          .25782618 2 13
          .14335221 2 14
          .21836656 3 13
          .1708736 3 14
          .24286278 4 13
          .16052626 4 14
          .25790977 2 13
          .14366569 2 14
          end
          label values tissueid tissueid
          label def tissueid 2 "rbc", modify
          label def tissueid 3 "serum", modify
          label def tissueid 4 "buffycoat", modify
          label values AA AA
          label def AA 13 "PHE", modify
          label def AA 14 "TYR", modify
          
          graph bar arcsinsqrt_nmolcomp, over(tissueid, label(angle(45))) over(AA) bar(1, color(black)) ylabel(0.0 0.1 0.2 0.3 0.4,nogrid) subtitle("E. Ring", position(11)) name(ring, replace)
          
          graph bar arcsinsqrt_nmolcomp, over(tissueid, label(angle(45))) over(AA) bar(1, color(black)) ylabel(0.0 0.1 0.2 0.3 0.4,nogrid) subtitle("F. Sulfur", position(11)) name(sulf, replace)
          exit
          running either bar command alone works fine. By the way, I tested from Stata 19 back to Stata 16, and get the same error as OP.

          Comment


          • #6
            Ok, I think I know what's going on, Andrea Huriega, please change name(ring, replace) in the command to something else, like name(g1, replace). Stata graphics system has an internal class named ring, when you use it as a graph name, it caused system confution, hence the error in the subsequent graph command.

            Comment


            • #7
              Ah perfect! That fixed the problem, thank you so much for the help!

              Comment

              Working...
              X