Hello,
I have a question with regard to margins. In my model, I am trying to estimate cross-level interactions between useonline, an individual level variable, and broadband, a region-level variable. I also use fixed effects at the regional level. Now, when I run the model like this below, and run margins for various levels of broadband observable in the data, Stata fails to estimate the marginal effects.
I first thought that this was because of region fixed effects. However, when I run the following command, it can estimate them for each value of broadband.
My question is are these commands not the same? Why does the first one fail, but the second one succeeds?
Relatedly, when I run the model without region fixed effects, and again run the same marginal effects codes above, both estimates run fine expectedly, but their results slightly differ from each other. Why is that?
Thank you very much
I have a question with regard to margins. In my model, I am trying to estimate cross-level interactions between useonline, an individual level variable, and broadband, a region-level variable. I also use fixed effects at the regional level. Now, when I run the model like this below, and run margins for various levels of broadband observable in the data, Stata fails to estimate the marginal effects.
Code:
logit trust i.regions c.useonline##c.broadband , vce(robust) nocons margins, dydx(useonline ) at (broadbandnuts=(86(1)98) ) . margins, dydx(useonline ) at (broadbandnuts=(86(1)98) ) Average marginal effects Number of obs = 1,127 Model VCE: Robust Expression: Pr(trust), predict() dy/dx wrt: useonline 1._at: broadbandnuts = 86 2._at: broadbandnuts = 87 3._at: broadbandnuts = 88 4._at: broadbandnuts = 89 5._at: broadbandnuts = 90 6._at: broadbandnuts = 91 7._at: broadbandnuts = 92 8._at: broadbandnuts = 93 9._at: broadbandnuts = 94 10._at: broadbandnuts = 95 11._at: broadbandnuts = 96 12._at: broadbandnuts = 97 13._at: broadbandnuts = 98 ------------------------------------------------------------------------------ | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- useonline | _at | 1 | . (not estimable) 2 | . (not estimable) 3 | . (not estimable) 4 | . (not estimable) 5 | . (not estimable) 6 | . (not estimable) 7 | . (not estimable) 8 | . (not estimable) 9 | . (not estimable) 10 | . (not estimable) 11 | . (not estimable) 12 | . (not estimable) 13 | . (not estimable) ------------------------------------------------------------------------------
Code:
margins, dydx(useonline ) over(broadband) Average marginal effects Number of obs = 1,127 Model VCE: Robust Expression: Pr(trust), predict() dy/dx wrt: useonline Over: broadbandnuts ------------------------------------------------------------------------------- | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- useonline | broadbandnuts | 86 | .2246624 .1033492 2.17 0.030 .0221018 .4272231 89 | .2701895 .0731823 3.69 0.000 .1267548 .4136242 90 | .2474129 .0626573 3.95 0.000 .1246068 .370219 93 | .2558975 .0417731 6.13 0.000 .1740236 .3377714 94 | .2583967 .0419266 6.16 0.000 .176222 .3405714 95 | .2524966 .0475349 5.31 0.000 .1593298 .3456633 96 | .2580284 .0627717 4.11 0.000 .134998 .3810587 98 | .2501801 .0947657 2.64 0.008 .0644428 .4359174 -------------------------------------------------------------------------------
Relatedly, when I run the model without region fixed effects, and again run the same marginal effects codes above, both estimates run fine expectedly, but their results slightly differ from each other. Why is that?
Thank you very much
Comment