Announcement

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

  • Generating forest plot of IRR form poisson regression

    Hello,

    I am relatively knew to stata and would like to create a forest plot of the IRRs from a poisson regression for a single outcome. I am able to convert my data to average marginal effects and then plot the data but I was wondering if there was any way to do this with the IRRs from the poisson regression?

    Thanks

    David

  • #2
    Hello David,

    Welcome to the Stata Forum.

    I'm not sure if it is the best thing to do, since I believe the marginal effects are the best option. I guess that is the main reason your query rested unanswered so far.

    That said, just to provide you some food for thought, perhaps you should take an "inspirational" look (as I did) at this article (http://www.stata-journal.com/sjpdf.h...iclenum=gr0045) written by Nick Cox, specifically where he comments on confidence-interval plots.

    Indeed, I gather you may use - twoway rcap highci lowci predictors, hor - for the confidence intervals in the first part, and invert the variables in the second part, something like - scatter predictors irr.

    Below, I tried to post the graph so as you may take a look, but I think you can reproduce these commands without difficulties.

    Please keep in mind that, first, you need to create a small dataset with just the IRR and CIs for the predictors, and label them accordingly.

    Finally, I still think this is not a great idea, and you'd better stick to the - margins - command.

    Hopefully that helps!


    Best,

    Marcos
    Attached Files
    Last edited by Marcos Almeida; 05 Nov 2015, 07:22.
    Best regards,

    Marcos

    Comment


    • #3
      Hi Marcos,

      Thank you for your insightful reply.

      Do you mind if I inquire further as to why you do not think plotting the IRRs is a good idea? It would be simply presenting the IRRs and CI in graphical form as opposed to table which I thought might be more visually appealing; however, if there is an error in doing this I would gladly switch to graphing the marginal effects.

      Thanks again, kind regards

      David

      Comment


      • #4
        HI David,

        another way to present coefficients not only from poisson-regressoin is the great coefplot (SSC) command by Ben Jann.
        It works fine with margins and irr and you can drop every var you don“t need from the graph using the drop option

        Code:
        ssc install coefplot
        
        *see help coefplot
        
        use "http://www.ats.ucla.edu/stat/stata/dae/poisson_sim", clear
        recode math (0/49 = 1 "low") (50/100 =2 "high"), gen (math_r)
        
        *irr
        poisson num_awards i.prog i.math_r, irr
        
        coefplot,   ///
            xline(1) ///
            headings( ///
                2.prog="{bf:Type of Program} (ref. general)" ///
                2.math_r="{bf:math score} (ref. low)" ) ///
            drop(_cons) ///
            xtitle("irr") ///
            ciopts(recast(rcap))  
            
        *margins
        poisson num_awards i.prog i.math_r
        margins, dydx(*) post
        
        coefplot,   ///
            xline(0) ///
            headings( ///
                2.prog="{bf:Type of Program} (ref. general)" ///
                2.math_r="{bf:math score} (ref. low)" ) ///
            drop(_cons) ///
            xtitle("AME") ///
            ciopts(recast(rcap))

        Comment


        • #5
          Hello David,

          I think - margins - and - marginsplot - allow a vast array of possibilities, if compared to the visual display of the predictor's IRRs, I mean, the presentation of the IRRs with the CI in a table seems to me just fine, whereas - marginsplot - would provide more options, such as the MEs, AMEs, selecting levels or specifying means, etc.

          There is an interesting discussion on margins (not exactly on the same issue as yours) here: http://www.statalist.org/forums/foru...-after-poisson

          Also, this article (http://www.ats.ucla.edu/stat/stata/dae/poissonreg.htm) applies - margins - so as to provide a "better understanding" of the model, in spite of having already estimated the IRRs, and, of course, showing there is no conflict between them.

          In short, it may be a matter of taste, but I think - margins - and - marginsplot - have among the pros the fact of being promptly "customizable" to the analyzer's needs and graphically presenting the effect size of whichever particularity from the model.

          Kind regards,

          Marcos
          Best regards,

          Marcos

          Comment

          Working...
          X