Announcement

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

  • Drop "mlabel" from coefplot for a "base" variable

    Dear Stata Users,

    Can you please help me to identify a way how to avoid placing "mlable" over a "base" variable from the regression? I use the formula below:
    Code:
    coefplot, vertical base keep(1.event 2.event  3.event) omitted coeflabels(1.event = "{bf:event1}" 2.event = "{bf:event2}" 3.event = "{bf:event3}" 4.event = "{bf:event4}", labsize(small)) msymbol(d)   mfcolor(white)  recast(connected) byopts(yrescale) levels(99 95 90) ciopts(lwidth(1.2 ..)  lcolor( *.9 *.6 *1))   legend(subtitle("Confidence Interval")) xline(4.5, lcolor(red) lpattern(dash))  mlabposition(1)  mlabposition(1)  mlabgap(*1.5)  mlabel("{it:p}="+string(@pval,"%9.2f" ))
    I am getting the following graph and would like to get rid of the mlabel - "p=." in the "event4"

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	30.0 KB
ID:	1640330




  • #2
    coefplot is from the Stata Journal / SSC, as you are asked to explain (FAQ Advice #12). As always, you will increase your chances of obtaining a helpful reply by providing a reproducible example. See the same referenced FAQ. Your question is however interesting enough for me to create a reproducible example. Specifying a condition within -mlabel()- is allowed. The base level has coefficient 0.

    Code:
    sysuse auto, replace
    regress mpg weight i.rep78
    coefplot, baselevels mlabel(cond(@b!=0, "{it:p}= " + string(@pval,"%9.3f"), "" )) mlabpos(1) drop(_cons)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	57.7 KB
ID:	1640361

    Comment


    • #3
      Thank you for your help!

      Comment

      Working...
      X