Announcement

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

  • #16
    Thank you both of you for the discussion above! So it seems that margins can't do it after all.

    Comment


    • #17
      There is a Wish List for Stata 15 thread. You might go there and post your wish for margins and link back to this thread. If there really is a way to already do what you want you may get a response back in that thread. This seems like a reasonable request to me and perhaps not that hard to do.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #18
        If all that is wanted is a scatter-plot showing the 95% prediction (or forecast) interval bands, I've just learned from Dupont's (2009) book (Statistical Modeling for Biomedical Researchers) that this can be achieved by adding the stdf option to a twoway command. Here is Dupont's code:

        Code:
        *  Add 95% prediction interval bands to the preceding graph.
        *
        twoway lfitci glyco ph,  stdf ciplot(rline) color(gray)   ///
            || lfitci glyco ph, lpattern(solid)                 ///
            || scatter glyco ph                        ///
            , ylabel(0(50)300) xlabel(6.9 (.1) 7.5)             ///
              ytitle(Plasma Glycolate (mg/dl)) legend(off)
        And here is the resulting graph:

        Click image for larger version

Name:	Dupont_2009_Fig2.9.png
Views:	1
Size:	22.1 KB
ID:	1375578


        The data file and Dupont's complete code can be found at the following links.
        Cheers,
        Bruce
        --
        Bruce Weaver
        Email: [email protected]
        Version: Stata/MP 18.5 (Windows)

        Comment


        • #19
          Originally posted by Bruce Weaver View Post
          If all that is wanted is a scatter-plot showing the 95% prediction (or forecast) interval bands, I've just learned from Dupont's (2009) book (Statistical Modeling for Biomedical Researchers) that this can be achieved by adding the stdf option to a twoway command. Here is Dupont's code:

          Code:
          * Add 95% prediction interval bands to the preceding graph.
          *
          twoway lfitci glyco ph, stdf ciplot(rline) color(gray) ///
          || lfitci glyco ph, lpattern(solid) ///
          || scatter glyco ph ///
          , ylabel(0(50)300) xlabel(6.9 (.1) 7.5) ///
          ytitle(Plasma Glycolate (mg/dl)) legend(off)
          And here is the resulting graph:

          [ATTACH=CONFIG]n1375578[/ATTACH]

          The data file and Dupont's complete code can be found at the following links.
          Cheers,
          Bruce
          Bruce thanks for this that's really nice!
          But if it's so easy to draw the limits in a graph, it should be easy to extract the limites for a specified X value.
          Is it?
          Thanks again very helpful thread!


          Comment

          Working...
          X