Announcement

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

  • Generating a graph for Odds Ration and CI from logistic regression results

    I want to plot the results of logistic regression in Stata 13. The DV is Obesity. Main predictor variable is Cum_RF which has four categories, 0-3. The x-axis will show the ORs and the Y-axis will show the name of the covariates. Something like this-


    Click image for larger version

Name:	OR.PNG
Views:	1
Size:	67.0 KB
ID:	1489667


    From other posts I have found the following command for a similar question as mine:

    #delim ; logistic BMIcat5 ib0.Cum_RF ib1.Sex01 Section1C3 ib2.MaritalNew ib1.HHncome_CatN ib01.EduLvl_Cat ib0.NevrSmok;
    parmest, norestore eform label; sencode label, gene(parmlab);
    twoway scatter parmlab estimate,
    xline(1) ylab(, valuelabel angle(0)) ||
    rcap min95 max95 parmlab,
    horizontal legend(order(1 "point estimate"
    2 "95% conf. int.") pos(6))
    xlabel(0(1)12) xtitle("Odds Ratio") ytitle("");



    And this is the output I get:


    1)adjusted model
    Logreg.PNG


    2) The OR graph


    h Output.PNG



    My problems are: 1) How to show the OR and CI of all the categories of the Cum_RF variable? 2) How to rescale the graph so that the x-axis markers are well spread out instead of being congested in the left corner?
    Last edited by Josna Rani; 23 Mar 2019, 05:24.

  • #2
    You may wish to take a look at the user-written - coefplot - for that matter.
    Best regards,

    Marcos

    Comment

    Working...
    X