Hello Statausers,
I would like to ask you a question about margins command. I have run a regression model and I want to post-estimate the marginal effect of two factor variables: TITULACION and FLIPPED. The model is:
If I estimate the margin of the interaction TITULACION##FLIPPED
The problem is that the output when FLIPPED=No is not reported, even it is not in the marginsplot

But if the code of the margins comand is:
The result is an error message: "at values for factor FLIPPED do not sum to 1
r(198);"
I want to generate a marginsplot like this, but with two line one for FLIPPED=1 and other for FLIPPED=0, and in the X axis the categories for TITULACION

Thanks for you help,
Best,
Rocio
I would like to ask you a question about margins command. I have run a regression model and I want to post-estimate the marginal effect of two factor variables: TITULACION and FLIPPED. The model is:
HTML Code:
. regress EXAMEN_10 i.SEXO EDAD i.TRABAJA VECES_PRESENTADO PRE_CLASS IN_CLASS ib3.TITULACION i.F > LIPPED, vce(robust) noconst Linear regression Number of obs = 47 F(10, 37) = 60.33 Prob > F = 0.0000 R-squared = 0.9303 Root MSE = 1.7832 ---------------------------------------------------------------------------------- | Robust EXAMEN_10 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- SEXO | Male | .1176539 .562293 0.21 0.835 -1.02166 1.256968 EDAD | .0498757 .041558 1.20 0.238 -.0343288 .1340802 | TRABAJA | No | -.152863 .6520936 -0.23 0.816 -1.47413 1.168404 Sporadically | .5782017 .7386561 0.78 0.439 -.9184577 2.074861 | VECES_PRESENTADO | .5914525 1.391224 0.43 0.673 -2.227436 3.410341 PRE_CLASS | -.2131888 .2993504 -0.71 0.481 -.8197304 .3933529 IN_CLASS | .0327935 .333986 0.10 0.922 -.6439264 .7095134 | TITULACION | GADE | 2.313079 .7710534 3.00 0.005 .7507762 3.875381 GADE&DER | 3.058591 1.368283 2.24 0.032 .2861865 5.830996 | FLIPPED | Yes | 3.290253 1.621946 2.03 0.050 .003879 6.576627 ----------------------------------------------------------------------------------
HTML Code:
. . margins i.TITULACION##i.FLIPPED Predictive margins Number of obs = 47 Model VCE : Robust Expression : Linear prediction, predict() ------------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. t P>|t| [95% Conf. Interval] -------------------+---------------------------------------------------------------- TITULACION | GADE | 6.090142 .3121682 19.51 0.000 5.457629 6.722655 GADE&DER | 6.835655 1.131745 6.04 0.000 4.542521 9.128788 GFICO | 3.777063 .6633242 5.69 0.000 2.433041 5.121086 | FLIPPED | Yes | 5.678936 .2601059 21.83 0.000 5.151911 6.205961 | TITULACION#FLIPPED | GADE#Yes | 6.090142 .3121682 19.51 0.000 5.457629 6.722655 GADE&DER#Yes | 6.835655 1.131745 6.04 0.000 4.542521 9.128788 GFICO#Yes | 3.777063 .6633242 5.69 0.000 2.433041 5.121086 ------------------------------------------------------------------------------------
But if the code of the margins comand is:
HTML Code:
margins, at (FLIPPED=(0 1) TITULACION=(1 2 3))
r(198);"
I want to generate a marginsplot like this, but with two line one for FLIPPED=1 and other for FLIPPED=0, and in the X axis the categories for TITULACION
Thanks for you help,
Best,
Rocio
Comment