Announcement

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

  • coefplot graph: how to drop _cons in mixed-model graph?

    I have a logistic regression graph which contains an unadjusted (univariate) model between age, gender, ethnicity, etc, and also a fully adjusted (multivariate) model which shows how each variable changes between the unadjusted and adjusted models.

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	111.7 KB
ID:	1540319

    I want to drop the “Constant” off the y-axis (and the corresponding data point). I managed to drop the combined unadjusted _cons (which overlapped constants from each of the variables), but can’t get rid of the adjusted _cons. Does anyone have a suggestions as to how I could do that? This is my code:

    quietly eststo m1: logit Actioned ageY
    quietly eststo m2: logit Actioned Gender
    quietly eststo m3: logit Actioned i.Ethnicity
    quietly eststo m4: logit Actioned i.quintile
    quietly eststo m5: logit Actioned ltdxCount
    quietly eststo m6: logit Actioned ltrxCount
    quietly eststo m7: logit Actioned ageY Gender i.Ethnicity i.quintile ltdxCount ltrxCount
    coefplot (m1, offset(.15))(m2, offset(.15))(m3, offset(.15))(m4, offset(.15))(m5, offset(.15))(m6, offset(.15)) (m7, drop(*#*) offset(-.15)) (m7, keep(*#*) pstyle(p2)), legend(off) msymbol(D) mfcolor(white) ciopts(lwidth(*3) lcolor(*.6)) ///
    coeflabels(_cons = Constant, wrap(20) notick labcolor(black) labsize(medsmall) labgap(3)) drop(_cons) xline(1) eform xtitle(Odds ratio)


    Thank you!
    Last edited by Sharon Leitch; 08 Mar 2020, 18:37.

  • #2
    coefplot is from SSC, as you are asked to explain (see FAQ #12). Have you tried the following?

    Code:
    (m7, drop(*#* _cons) offset(-.15))

    Comment


    • #3
      Apologies for not listing the origin of coefplot (first time posting here). Thanks for your suggestion Andrew but this did not change the graph at all when incorporated with the m7 code listed above. When added in it's entirety to the coefplot line it did change the colour of the graph but nothing else - the multivariate constant term is still present.

      Comment


      • #4
        I think you will need to provide a reproducible example. Can you post a data example using dataex?

        Comment

        Working...
        X