Announcement

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

  • Overall title when using a by option with marginsplot

    I am using marginsplot (in V16.1) with a by option and getting a graph I like, but I can't figure out how to change or eliminate the overall title, the one below that says "Predictive Margins of.....". The title and subtitle options are associated with each by group graph. I tried putting a title option in the by option as in, by(c2gtmot, title("overall")) but it is not allowed.
    Thanks for your help.
    Bob

    margins aakircomb, at(bdage=(30(5)45)) by(c2gtmot)
    marginsplot, by(c2gtmot) ///
    ytitle("Pr(Outcome)") title("title") subtitle("subtitle",size(small)) ///
    legend(order(7 "AA\No Failed" 8 "AA\No Success" 9 "AB\No Failed" 10 "AB\No Success" 11 "AB\Yes Failed" 12 "AB\Yes Success") size(small)) ///
    ci1opts(color(maroon) ) plot1opts(lcolor(maroon) mcolor(maroon) lpattern(solid)) ///
    ci3opts(color(maroon) ) plot3opts(lcolor(maroon) mcolor(maroon) lpattern(shortdash)) ///
    ci5opts(color(maroon) ) plot5opts(lcolor(maroon) mcolor(maroon) lpattern(longdash)) ///
    ///
    ci2opts(color(dkgreen) ) plot2opts(lcolor(dkgreen) mcolor(dkgreen) lpattern(solid)) ///
    ci4opts(color(dkgreen) ) plot4opts(lcolor(dkgreen) mcolor(dkgreen) lpattern(shortdash)) ///
    ci6opts(color(dkgreen) ) plot6opts(lcolor(dkgreen) mcolor(dkgreen) lpattern(longdash)) ///
    xlabel(, format(%3.0f)) name(fail, replace)
    Attached Files
    Last edited by Bob Gerzoff; 03 Jul 2020, 05:13.

  • #2
    Found the answer: The by option has a byopt option within which you can specify the title. For example:

    marginsplot, by(c2gtmot) byopt(title ("This is the overall title", size(small)))
    Last edited by Bob Gerzoff; 05 Jul 2020, 06:45.

    Comment

    Working...
    X