Announcement

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

  • Prediction interval after xtreg instead of confidence interval

    I am running the following regression and then obtain a marginsplot

    Code:
    xtset iso
    
    xtreg lny i.year c.x1##c.x1 x2, robust fe
    
    margins, at(x1 = (-0.7(2)33)) 
    marginsplot, recast(line) recastci(rarea) plotopts(lcolor(dknavy)) ci1opts(color(ltblue)) graphregion(color(white))
    This provides me with the confidence interval - how can I obtain a similar plot with prediction intervals instead?

    I have tried the following:

    Code:
    predict yhat
    
    predict stdf, stdf
    However, I get the following error: option stdf not allowed.

    Any help to obtain the plot with prediction interval will be appreciated. Thank you.

    Sincerely,

    Chiara​​​​​​​

  • #2
    Subsequently crossposted on Stack Overflow at

    https://stackoverflow.com/questions/...dence-interval

    Comment


    • #3
      I know this is frowned upon. I apologise if this is against the rules, I can delete the other post. Thanks.

      Comment


      • #4
        No, it is not frowned on. What is asked of you is that you tell us about the cross-posting. The reasons are that nobody wants to waste time responding if your question has already been answered elsewhere, and if somebody else has the same question, searches here, and finds this thread, they should be able to find the answer at that other place as well.

        By the way, the reason I'm not actually answering your question is that I don't know.

        Comment


        • #5
          Clyde Schechter, I understand and should have edited my question. Thank you!

          Comment

          Working...
          X