Announcement

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

  • Relative Risk Plot in Stata

    Can someone tell me how to plot relative risk and 95% CI in stata. I used the cs command to estimate these parameters but am having trouble plotting them. Thank you!

  • #2
    You can combine plot types in Stata to get the effect you want, but better would be to first search Statalist:

    http://www.stata.com/statalist/archi.../msg00421.html

    Comment


    • #3
      Hello Melissa, and welcome to the forum. Here are a couple of possibilities that come to mind. (Bear in mind that I'm a relative newbie to Stata, and some of the grizzled old veterans may come along with better suggestions after they read this!)

      Code:
      * Use example from this UCLA page:
      * https://stats.idre.ucla.edu/stata/faq/how-can-i-estimate-relative-risk-using-glm-for-common-outcomes-in-cohort-studies/
      clear
      use https://stats.idre.ucla.edu/stat/stata/faq/eyestudy
      cs lenses carrot
      * return list
      generate Upper = r(ub_rr) // 95% CI upper bound
      generate Lower = r(lb_rr) // 95% CI lower bound
      generate RR = r(rr) // risk ratio (RR)
      generate byte Exposed = 1 // variable to use on X-axis of plot
      twoway rcap Upper Lower Exposed || scatter RR Exposed
      
      * Use -glm- to estimate RR, then use -coefplot- to plot it
      glm lenses i.carrot, fam(bin) link(log) nolog
      *coefplot, drop(_cons) yline(0) ytitle(ln(Risk Ratio)) vertical
      coefplot, drop(_cons) yline(1) ytitle(Risk Ratio) vertical eform
      Here are some links that may help you decipher what is going on in those examples. HTH.
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 19.5 (Windows)

      Comment


      • #4
        Try -eclplot- (downloadable from SSC); and if you want to use the dialog box after downloading it type -db eclplot-.

        Great tutorial here: http://www.imperial.ac.uk/nhli/r.new...ewson_ohp1.pdf
        __________________________________________________ __
        Assistant Professor, Department of Biostatistics and Epidemiology
        School of Public Health and Health Sciences
        University of Massachusetts- Amherst

        Comment


        • #5
          You can also check out -metan-, specially if you have subgroups. It plots RR and 95% CI, and is very flexible.

          http://www.stata-journal.com/sjpdf.h...clenum=sbe24_2

          Tiago

          Comment


          • #6
            ...or, alternatively, -admetan-, which is effectively an update of -metan- (which has not been updated for 7 years or so, as far as I'm aware!). Note that -admetan- is part of the -ipdmetan- package, downloadable from SSC.

            See: http://www.statalist.org/forums/foru...13#post1392313

            David.

            Comment


            • #7
              Hello,
              could anyone tell me how to use "ipdover" for logistic regression? Is it possible to use ipdover for case-control studies?

              Comment

              Working...
              X