Dear All,
I am seeking to estimate a logit model, where the binary dependent variable (e.g., pupils' uni admission) is explained by a binary independent variable (e.g., pupils' high parental SES), the effect of which depends on a continuous group-level moderator (e.g., school funding).
The challenge: I would like to focus on how the association between the independent variable and the outcome differs depending on a group characteristic, while holding all group characteristics that may affect the outcome fixed (and do not vary by independent variable), i.e., after using group fixed effects. That is, I am keen to estimate this model (and the subsequent marginal effects):
Given that the main/direct effect of the Moderator and the fixed effects for Group are perfectly collinear (by design), the main effect of Moderator cannot be estimated, and deriving the margins is tricky.
Is there any way to still derive predictions and marginal effects? Or an alternative that'd be of help to interpret the interaction?
am seeking to give some sensible interpretation to these results (e.g. compare predictions for Group 28 and 31), and to plot the results, e.g. as in marginsplot (but e.g. binscatter also thinkable), without having to drop the fixed effects altogether (which would be the easy thing to do, but I am reluctant to venture there).
Any help would be greatly appreciated!!
Here's a stylized dataex for the example above.
Many thanks in advance!
I am seeking to estimate a logit model, where the binary dependent variable (e.g., pupils' uni admission) is explained by a binary independent variable (e.g., pupils' high parental SES), the effect of which depends on a continuous group-level moderator (e.g., school funding).
The challenge: I would like to focus on how the association between the independent variable and the outcome differs depending on a group characteristic, while holding all group characteristics that may affect the outcome fixed (and do not vary by independent variable), i.e., after using group fixed effects. That is, I am keen to estimate this model (and the subsequent marginal effects):
Code:
global c "i.Binary##c.Control" global i "i.Binary##c.Moderator" logit DV i.Group $c $i ,vce(cluster Group) or margins, dydx(Binary) at(Moderator = (-1(1)1)) asobserved vsquish post noatlegend
Is there any way to still derive predictions and marginal effects? Or an alternative that'd be of help to interpret the interaction?
am seeking to give some sensible interpretation to these results (e.g. compare predictions for Group 28 and 31), and to plot the results, e.g. as in marginsplot (but e.g. binscatter also thinkable), without having to drop the fixed effects altogether (which would be the easy thing to do, but I am reluctant to venture there).
Any help would be greatly appreciated!!
Here's a stylized dataex for the example above.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float Group byte(DV Binary) float(Control Moderator) 10 0 0 1.522567 -1.423487 10 0 0 -.13660517 -1.423487 10 0 0 1.0248153 -1.423487 10 0 0 -.6343568 -1.423487 10 0 0 .8588981 -1.423487 10 0 1 1.0248153 -1.423487 10 0 1 .52706367 -1.423487 10 1 1 1.7714427 -1.423487 10 0 1 2.1032772 -1.423487 10 0 1 .27818787 -1.423487 11 1 0 .6100222 .029861337 11 0 0 -.05364656 .029861337 11 0 0 .52706367 .029861337 11 0 0 -.2195638 .029861337 11 0 0 -.7173154 .029861337 11 0 1 -.7173154 .029861337 11 0 1 -.9661912 .029861337 11 0 1 -1.5469013 .029861337 11 0 1 -.4684396 .029861337 11 0 1 -1.0491498 .029861337 15 1 0 1.6884842 -.697905 15 0 0 -1.463943 -.697905 15 0 0 .6929809 -.697905 15 0 0 1.1907325 -.697905 15 1 0 1.273691 -.697905 15 0 1 -.4684396 -.697905 15 0 1 .52706367 -.697905 15 0 1 1.7714427 -.697905 15 0 1 .4441051 -.697905 15 0 1 1.0248153 -.697905 17 0 0 -.8832326 .6419196 17 0 0 -1.1321084 .6419196 17 0 0 -1.0491498 .6419196 17 0 0 -.8832326 .6419196 17 0 0 -.9661912 .6419196 17 0 1 -1.463943 .6419196 17 0 1 -.9661912 .6419196 17 0 1 -1.2980257 .6419196 17 0 1 -1.5469013 .6419196 17 1 1 .27818787 .6419196 19 0 0 1.7714427 -1.1388315 19 0 0 -1.463943 -1.1388315 19 0 0 .9418567 -1.1388315 19 1 0 1.6884842 -1.1388315 19 0 0 -1.2980257 -1.1388315 19 0 1 -1.215067 -1.1388315 19 0 1 .11227065 -1.1388315 19 0 1 .3611465 -1.1388315 19 0 1 1.4396083 -1.1388315 19 0 1 .19522925 -1.1388315 22 0 0 .11227065 -.27745637 22 0 0 .19522925 -.27745637 22 0 0 -.13660517 -.27745637 22 1 0 .11227065 -.27745637 22 0 0 -.2195638 -.27745637 22 0 1 .6100222 -.27745637 22 0 1 1.273691 -.27745637 22 0 1 .11227065 -.27745637 22 0 1 .11227065 -.27745637 22 0 1 2.0203187 -.27745637 28 0 0 1.4396083 -.54138076 28 1 0 -.3025224 -.54138076 28 0 0 1.1907325 -.54138076 28 0 0 -1.2980257 -.54138076 28 0 0 1.522567 -.54138076 28 0 1 1.4396083 -.54138076 28 0 1 .4441051 -.54138076 28 0 1 -1.2980257 -.54138076 28 0 1 .6100222 -.54138076 28 0 1 .27818787 -.54138076 29 0 0 1.0248153 1.7323356 29 0 0 -.800274 1.7323356 29 0 0 .4441051 1.7323356 29 0 0 -.385481 1.7323356 29 0 0 .3611465 1.7323356 29 1 1 1.4396083 1.7323356 29 0 1 .6100222 1.7323356 29 0 1 -1.2980257 1.7323356 29 0 1 .029312044 1.7323356 29 0 1 -.13660517 1.7323356 31 0 0 1.0248153 .02299988 31 0 0 .27818787 .02299988 31 0 0 -1.215067 .02299988 31 0 0 .8588981 .02299988 31 1 0 -.385481 .02299988 31 0 1 1.6884842 .02299988 31 0 1 -.3025224 .02299988 31 0 1 -.8832326 .02299988 31 0 1 1.273691 .02299988 31 0 1 1.3566496 .02299988 32 0 0 .7759395 .709194 32 0 0 -1.463943 .709194 32 0 0 .3611465 .709194 32 1 0 -.4684396 .709194 32 0 0 -.05364656 .709194 32 0 1 -1.0491498 .709194 32 0 1 -1.215067 .709194 32 0 1 -.7173154 .709194 32 0 1 -1.0491498 .709194 32 0 1 .4441051 .709194 33 1 0 1.1907325 1.2920736 33 0 0 -.8832326 1.2920736 33 0 0 .3611465 1.2920736 33 0 0 -1.215067 1.2920736 33 0 0 -.2195638 1.2920736 33 0 1 -.8832326 1.2920736 33 0 1 -.5513982 1.2920736 33 0 1 -.6343568 1.2920736 33 0 1 -.05364656 1.2920736 33 0 1 -1.3809842 1.2920736 34 1 0 -.05364656 -.12098723 34 0 0 .3611465 -.12098723 34 0 0 .11227065 -.12098723 34 0 0 .6929809 -.12098723 34 0 0 1.7714427 -.12098723 34 0 1 -1.215067 -.12098723 34 0 1 -1.5469013 -.12098723 34 0 1 .11227065 -.12098723 34 0 1 -.800274 -.12098723 34 0 1 .9418567 -.12098723 35 0 0 -1.2980257 1.3944004 35 0 0 -1.62986 1.3944004 35 0 0 -1.3809842 1.3944004 35 0 0 -.7173154 1.3944004 35 0 0 -1.1321084 1.3944004 35 0 1 -1.2980257 1.3944004 35 0 1 .6929809 1.3944004 35 1 1 -.2195638 1.3944004 35 0 1 .7759395 1.3944004 35 0 1 -1.1321084 1.3944004 37 0 0 -.3025224 .15224363 37 0 0 -1.215067 .15224363 37 0 0 1.8544014 .15224363 37 0 0 -.3025224 .15224363 37 1 0 .11227065 .15224363 37 0 1 -1.2980257 .15224363 37 0 1 -.800274 .15224363 37 0 1 -.5513982 .15224363 37 0 1 -1.215067 .15224363 37 0 1 -.5513982 .15224363 38 1 0 .27818787 -1.77498 38 0 0 .029312044 -1.77498 38 0 0 .6100222 -1.77498 38 0 0 -.7173154 -1.77498 38 1 0 -.05364656 -1.77498 38 0 1 -.8832326 -1.77498 38 0 1 1.6055255 -1.77498 38 0 1 1.8544014 -1.77498 38 0 1 .19522925 -1.77498 38 0 1 .7759395 -1.77498 end
Comment