Announcement

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

  • trouble labelling y-axis

    Hello there, is there a quick & easy way to keep the y-axis the same, when I am running multiple plots of different associations between my dependent and independent variable.

    I am running ~15 different plots of my DV against 15 different IVs but in each case, my DV is being measured along different values. I would like it to stay consistent between 14-30. I think I will use the ylabel option for this (ylabel(14(.5)30)... but I am not sure where in the following code it should go:

    regress logIOP c.systol3_out##i.male
    regress, noheader eform("Exp(B)")
    quietly margins male, at(systol3_out=(80(10)200)) expression(exp(predict(xb)))
    marginsplot, scheme(s1color) xtitle("Systolic Blood Pressure (mmHg)") xlab(,grid) ytitle("Geometric mean IOP") ylab(,grid) yscale(log) title("Association between IOP and Systolic Blood Pressure, by sex)

  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.
    One strategy that sometimes helps is to use the interactive interface to do what you want. Stata then shows you the command.

    regress, noheader eform("Exp(B)")
    quietly margins male, at(systol3_out=(80(10)200)) expression(exp(predict(xb)))
    marginsplot, scheme(s1color) xtitle("Systolic Blood Pressure (mmHg)") xlab(,grid) ytitle("Geometric mean IOP") ylab(,grid) yscale(log) ylabel(14(.5)30) title("Association between IOP and Systolic Blood Pressure, by sex)

    should work.
    This code does work on my estimates
    .
    . marginsplot ,recast(line) noci plot1opts(lpattern(line) lcolor(black) ) ///
    > plot2opts(lpattern("--")lcolor(blue) ) plot3opts(lpattern("-..-..") lcolor(red) ) ///
    > ytitle("Predicted OEE + Offset") ylabel(72(2)82) ///
    > legend(on order(1 "**ile" 2 "** %tile" 3 "** %tile" )) ///
    > title(Predicted **s)

    Comment

    Working...
    X