Announcement

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

  • two way scatter plot, command is unrecognized

    I tried to graph a two way scatter plot, here is my code:
    tw scatter or id, xlabel(1(1)`max', valuelabel angle(45) labsize(*0.5))
    xtitle("") ytitle("Odds Ratio") yscale(log) || ///
    rcap lb ub id, legend(off)

    but i got results showed:
    command xtitle is unrecognized
    command rcap is unrecognized

    may i know how to solve it? Thanks.

  • #2
    Looks like you forgot to include /// at the end of your first line:

    Code:
    tw scatter or id, xlabel(1(1)`max', valuelabel angle(45) labsize(*0.5)) ///
    xtitle("") ytitle("Odds Ratio") yscale(log) || ///
    rcap lb ub id, legend(off)

    Comment


    • #3
      Originally posted by Ali Atia View Post
      Looks like you forgot to include /// at the end of your first line:

      Code:
      tw scatter or id, xlabel(1(1)`max', valuelabel angle(45) labsize(*0.5)) ///
      xtitle("") ytitle("Odds Ratio") yscale(log) || ///
      rcap lb ub id, legend(off)
      Hi Ali,
      Thank you for your reply, I included /// at the end of my first line before, and if i included it, I then got the results showed:
      option / not allowed
      command xtitle is unrecognized
      command rcap is unrecognized

      so i tried to run the command line by line, but it still doesn't work. is there any other reasons and solutions for this problem? thank you!

      Comment


      • #4
        You need to run the code from a do-file, rather than interactively (directly from the command-line). If you want to run it interactively, you cannot use the /// comment indicator, rather you will need to combine the whole command into a single line:

        Code:
        tw scatter or id, xlabel(1(1)`max', valuelabel angle(45) labsize(*0.5)) xtitle("") ytitle("Odds Ratio") yscale(log) || rcap lb ub id, legend(off)
        From https://www.stata.com/manuals/u16.pdf:

        Code:
        The /* */, //, and /// comment indicators can be used in do-files and ado-files only; you may not use them interactively. You can, however, use the ‘*’ comment indicator interactively.

        Comment


        • #5
          Originally posted by Ali Atia View Post
          You need to run the code from a do-file, rather than interactively (directly from the command-line). If you want to run it interactively, you cannot use the /// comment indicator, rather you will need to combine the whole command into a single line:

          Code:
          tw scatter or id, xlabel(1(1)`max', valuelabel angle(45) labsize(*0.5)) xtitle("") ytitle("Odds Ratio") yscale(log) || rcap lb ub id, legend(off)
          From https://www.stata.com/manuals/u16.pdf:

          Code:
          The /* */, //, and /// comment indicators can be used in do-files and ado-files only; you may not use them interactively. You can, however, use the ‘*’ comment indicator interactively.
          Thank you! problem solved!

          Comment

          Working...
          X