Announcement

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

  • mlabformat -- show only decimals

    Dear Statalisters,

    I am graphing marginal effects through marginsplot. I am adding labels with the mean estimates to the graph .

    Code:
    mplotoffset, xdim(wave5)   ///
    plot2opt(color(navy) msymbol("O") msize(large)  mlabel(_margin) mlabp(6) mlabc(navy) mlabformat(%5.3f) mlabgap(huge) mlabsize(medlarge) mlabangle(90) mlabangle(90)   ) ci2opts(lcolor(navy) lwidth(thick )) ///
    plot3opt(color(black) msymbol("D") msize(large)   mlabel(_margin) mlabp(6) mlabc(black) mlabformat(%5.3f) mlabgap(huge) mlabsize(medlarge) mlabangle(90) mlabangle(90)  ) ci3opts(lcolor(black) lwidth(thick )) ///
    plot1opt(color(green) msymbol("T") msize(large)   mlabel(_margin) mlabp(6) mlabc(green) mlabformat(%5.3f) mlabgap(huge) mlabsize(medlarge) mlabangle(90) mlabangle(90)  ) ci1opts(lcolor(green) lwidth(thick )) ///
    ylab( 0.05 "0.05" 0.1 "0.1" .2 "0.2" , labsize(vlarge))

    To fix the format of the label, I use mlabformat(%5.3f). However, since I am graphing probabilities, the first digit is zero. I would like to omit the zero and show only decimals. For instance, I would like this

    0.013 --> .013

    It would also be ideal to show percentages but I am not sure there is a way to obtain them through marginsplot by just modifying the variable format.

    Thank you and best,
    Lydia
Working...
X