Announcement

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

  • Coefplot: Baselevels not displayed

    Hello everyone,

    I am running various multilevel logistic regressions with differing binary explanatory variables and want to display the odds ratios of the respective coefficients in a single graph. Simultaneously, I would like to include the baselevels, i.e. explanatory variable==0, in the graph. However, when specifying the baselevels and/or omitted option, the baselevels still do not appear in the final graph. I use Stata version 15 and my code looks as such:

    melogit LR_decline volunteerwork i.agecat i.educ_impute i.wealthgroup female ///
    foreign_impute inactivity || country:, or
    eststo m1_vol
    melogit LR_decline educationalcourse i.agecat i.educ_impute i.wealthgroup female ///
    foreign_impute inactivity || country:, or
    eststo m1_edu
    melogit LR_decline clubs i.agecat i.educ_impute i.wealthgroup female ///
    foreign_impute inactivity || country:, or
    eststo m1_clu
    melogit LR_decline reading i.agecat i.educ_impute i.wealthgroup female ///
    foreign_impute inactivity || country:, or
    eststo m1_rea
    melogit LR_decline numbergames i.agecat i.educ_impute i.wealthgroup female ///
    foreign_impute inactivity || country:, or
    eststo m1_num
    melogit LR_decline strategicgames i.agecat i.educ_impute i.wealthgroup female ///
    foreign_impute inactivity || country:, or
    eststo m1_str
    *
    coefplot m1_edu m1_clu m1_rea m1_num m1_str, keep( volunteerwork ///
    educationalcourse clubs reading numbergames strategicgames ) eform ///
    baselevels recast(bar) barwidth(0.35) vert citop ciopts(recast(rcap)) ///
    scheme(cleanplots) yline(1) legend(off)

    My main explanatory variables are volunteerwork, educationalcourse, clubs, reading, numbergames, and strategicgames respectively. I would be thankfull for any help!

    My output looks like this:

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	106.2 KB
ID:	1689917

  • #2
    add i. prefix,
    Code:
    ebuse bangladesh, clear
    eststo nobase: melogit c_use child1 || district:
    eststo base: melogit c_use i.child1 || district:
    coefplot nobase base, keep(*child1) base

    Comment


    • #3
      Thank you! Worked like a charm

      Comment

      Working...
      X