****** DUPLICATE POST ******
Please follow the link to reply: Expand yaxis in marginsplot - Statalist
As the underneath is a duplicate of the post in the link above. Sorry for the inconvinence!
I'm doing a marginsplot after a multilevel regression analysis with an addplot of two medians. Marginsplot and 1 of the medians belongs to the left yaxis, the other median belongs to the right yaxis.
I would like to expand the left yaxis belonging to my marginsplot. Currently the left yaxis is ranging from 77-85, however I would like it to be going from 0 to 100.
I have tried "yscale" and "ylabel" without any luck.
My commands are:
* Multilevel regression:
mixed n_int_cr i.years_since_first_li i.sex c.age || dw_ek_borger:
* Graph
quietly margins, at(years_since_first_li= (1 (1) 10))
marginsplot, recast(line) recastci(rarea) plot1opts(lcolor(gs8)) ciopt(color(black%20)) ytitle("µmol/L") title("Creatinine") xtitle("Lithium treatment (years)") addplot(line median_cr_intsv_grp years_since_first_li, yaxis(1) ||line median_li_intsv_grp years_since_first_li, yaxis(2) ylabel(0 (0.2) 1, axis(2)) yscale(alt axis(2)) ytitle(mmol/L, axis(2)))
So my questions is: How do i change the yaxis?
Thank you,
Anne Joergensen
Please follow the link to reply: Expand yaxis in marginsplot - Statalist
As the underneath is a duplicate of the post in the link above. Sorry for the inconvinence!
I'm doing a marginsplot after a multilevel regression analysis with an addplot of two medians. Marginsplot and 1 of the medians belongs to the left yaxis, the other median belongs to the right yaxis.
I would like to expand the left yaxis belonging to my marginsplot. Currently the left yaxis is ranging from 77-85, however I would like it to be going from 0 to 100.
I have tried "yscale" and "ylabel" without any luck.
My commands are:
* Multilevel regression:
mixed n_int_cr i.years_since_first_li i.sex c.age || dw_ek_borger:
* Graph
quietly margins, at(years_since_first_li= (1 (1) 10))
marginsplot, recast(line) recastci(rarea) plot1opts(lcolor(gs8)) ciopt(color(black%20)) ytitle("µmol/L") title("Creatinine") xtitle("Lithium treatment (years)") addplot(line median_cr_intsv_grp years_since_first_li, yaxis(1) ||line median_li_intsv_grp years_since_first_li, yaxis(2) ylabel(0 (0.2) 1, axis(2)) yscale(alt axis(2)) ytitle(mmol/L, axis(2)))
So my questions is: How do i change the yaxis?
Thank you,
Anne Joergensen
