Dear Statalist,
I am trying to do a margin for an interaction depending on different values. I would like to do something like the next graph I will show. This is a toy model with the interactions I want to plot.
Thereafter, I want the margins for the 25 and 75 percentiles of Boffshoring, that is, I need two different curves (25th and 75th) for several values of the other variable. But instead, it just give me for the 75th.
Is there any way to do something like the next graph?
Many thanks in advance.
I am trying to do a margin for an interaction depending on different values. I would like to do something like the next graph I will show. This is a toy model with the interactions I want to plot.
Code:
mixed innprod L.offshoring L.c.Boffshoring##L.c.newlnBS_offshoring##L.c.newlnBS_offshoring ||new_xactin: ||ident: L.offshoring , cov(unstructure)
Code:
margins, at(L.newlnBS_offshoring = (0 (0.8) 4) (p25)(p75)L.Boffshoring) Predictive margins Number of obs = 93,036 Expression : Linear prediction, fixed portion, predict() 1._at : L.Boffshor~g = 0 (p75) L.newlnBS_~g = 0 2._at : L.Boffshor~g = 0 (p75) L.newlnBS_~g = .8 3._at : L.Boffshor~g = 0 (p75) L.newlnBS_~g = 1.6 4._at : L.Boffshor~g = 0 (p75) L.newlnBS_~g = 2.4 5._at : L.Boffshor~g = 0 (p75) L.newlnBS_~g = 3.2 6._at : L.Boffshor~g = 0 (p75) L.newlnBS_~g = 4 ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _at | 1 | .6513781 .1626375 4.01 0.000 .3326143 .9701418 2 | .6424268 .2395786 2.68 0.007 .1728614 1.111992 3 | .6149054 .3314346 1.86 0.064 -.0346945 1.264505 4 | .5688139 .4381152 1.30 0.194 -.2898761 1.427504 5 | .5041523 .5595803 0.90 0.368 -.5926049 1.60091 6 | .4209207 .6958102 0.60 0.545 -.9428422 1.784684 ------------------------------------------------------------------------------ marginsplot, xdim(L.newlnBS_offshoring)
Many thanks in advance.
Comment