Announcement

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

  • Manual text on plot for margincontplot

    Hi, I'd like to insert text onto a plot using plotopts(twoway_options) feature in mcp. E.g.

    sysuse auto, clear
    gen inv_price = 1/price
    logit foreign inv_price
    sum price
    range w1 r(min) r(max) 20
    gen inv_w1 = 1/w1
    mcp price (inv_price), var1(w1 (inv_w1)) show ///
    plot(text(0.35 5000 "hello", place(e)))

    This code produces the error "invalid point, hello". Does anyone know why this isn't working?

    Thanks.

  • #2
    You can try the code below. As you'll notice, in the last line, I changed the plot option's content to generate what you want. I believe this is an unintentional programming bug, so you can report this to Patrick Royston, the author of the program. The bug can be fixed easily in the ado file so that your code can run without errors.

    Code:
    program drop _all
    sysuse auto, clear
    gen inv_price = 1/price
    logit foreign inv_price
    sum price
    range w1 r(min) r(max) 20
    gen inv_w1 = 1/w1
    mcp price (inv_price), var1(w1 (inv_w1)) show plot(`"text(0.35 5000 "hello")"')
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	9.2 KB
ID:	1345048

    Comment


    • #3
      Thanks much. Will report.

      Comment

      Working...
      X