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()
weakivtest for 2 endogenous variables caseHi Folks, I am using the -ivreg2- command with 2 endogenous variables, but don't know which weak in…
How to display the scale in the center instead of the note and show the 0 in front of the decimal point when using radar commandHello, I have been trying to make a radar graph but I found that when I use the external command rad…
stmixed for recurrent time-to-event dataHi all, I am doing an individual participant data (IPD) meta-analysis on recurrent time-to-event dat…
Durbin–Watson d-statisticregress lnhartlepool1 lnsunderland1 Source | SS df MS Number of obs = 842 -------------+-----------…
DID parallel trend test with 1 year pre period and 1 year post peiodHello! I have conducted a staggered DID where different firms' events happen in different years. Fo…
Subscribe to:
Post Comments (Atom)
0 Response to Marginsplot, legend and by()
Post a Comment