Dear Stata Users,
I am producing a graph with marginsplot throug the following commands and options
svy: logit event1 ib1.tercile2##i.agesm##i.sex i.wave5 i.livingpar i.ukborn i.sex i.educ2 if marital==1&age>17&age<36&evunion ==2&jbstat!=7&ivfioall==1, or level(90)
outreg2 using model_sex_new, word label replace level(90) eform
margins i.sex#i.agesm, level(90) post atmeans dydx(tercile2)
outreg2 using margisex, level(90) replace word label
marginsplot , xdim(agesm) by(sex) ///
plot1opt(msymbol("O") msize(vlarge)) ci1opts(lwidth(medium thick) ) ///
......
When I run my mplotoffset in the following way I produce a graph without the legend (just to notice tercile2 is a bivariate variable)
marginsplot, xdim(agesm) by(sex) ///
plot1opt(msymbol("O") msize(vlarge)) ci1opts(lwidth(medium thick) ) ///
......
When I force the legend through legend(on), the legend is split into two, whereas I would like to have one single legend
(I tried to upload the file,but it kept on loading with no result. Maybe it was too heavy?)
When I put legend into by, I have an error message, which says that that operation is not allowed.
marginsplot , xdim(agesm) by(sex, legend(on)) ///
plot1opt(msymbol("O") msize(vlarge)) ci1opts(lwidth(medium thick) ) ///
......
Is there the possibility of getting what I need?
Thank you. Best,
Lydia
Related Posts with Marginsplot, legend and by()
How to find the value of a variable using condition on another variable?Hi Statalist users, I have a dataset of which I am posting a snippet with relevant variables (age, …
Lag independent variable in fixed effects regression using repeated cross section dataHello Statalist, I'm currently analyzing repeated cross-section data (different individuals were su…
Two - step dynamic panel GMM estimator weight Matrix returning blank value after Mata loopHey guys, I am running a two-step joint dynamic panel GMM estimator on Mata, with the stacked formu…
xtaond2Hello, Would someone please tell me why the estimation results of the following two xtabond2 comman…
query about stata codeHello, I would like to confirm whether I generate a variable in a proper way. The definition is as f…
Subscribe to:
Post Comments (Atom)
0 Response to Marginsplot, legend and by()
Post a Comment