Announcement

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

  • two fpfit plots on one with estopts

    Hello stata-users,
    I have tried plotting two fpfit curves on one graph using
    Code:
    twoway (fpfit var1 var2) (fpfit var1 var2)
    which worked perfectly fine. For fractional polynomial fitting, it automatically assigns a degree but I wanted to increase the polynomial degree so I used the code
    Code:
    twoway fpfit var1 var2, estopts(degree(3))
    with varying degrees. But now that I am trying to put the two graphs together, it tells me that "option estopts() not allowed".
    Does anyone know why that might be happening?

  • #2
    What code is it that produces the error? This is fairly silly substantively, but it is syntax that works:


    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . twoway (fpfit mpg weight if foreign, estopts(degree(3))) (fpfit mpg weight if !foreign, estopts(degree(2)))

    Comment


    • #3
      To put estopts() with both fpfit commands looked redundant to me so I was using
      Code:
       twoway (fpfit var1 var2)(fpfit var1 var2), estopts(degree(3))
      .

      Your code works. I guess I just need to play around a little more to see how things fit. Thanks.

      Comment


      • #4
        That syntax of yours would imply that estopts is an option of twoway, and it is not. You placed the option call outside the fpfit parentheses.

        Comment

        Working...
        X