I am trying to calculate marginal effects of interaction terms but keep getting errors. Specifically, I would like to know how the effect of x3 on DV according the changes in the value of x2.
I used the following commands.
firthlogit DV x x1 c.x2## i. (x3 x4)
margins x2 , dydx(x3) atmeans expression (invlogit(predict(xb)))
factor x2 not found in list of covariates
r(322);
.margins c.x2 , dydx(x3) atmeans expression (invlogit(predict(xb)))
only factor variables and their interactions are allowed
r(198);
.margins c.x2 , dydx(i.x3) atmeans expression (invlogit(predict(xb)))
only factor variables and their interactions are allowed
I used the following commands.
firthlogit DV x x1 c.x2## i. (x3 x4)
margins x2 , dydx(x3) atmeans expression (invlogit(predict(xb)))
factor x2 not found in list of covariates
r(322);
.margins c.x2 , dydx(x3) atmeans expression (invlogit(predict(xb)))
only factor variables and their interactions are allowed
r(198);
.margins c.x2 , dydx(i.x3) atmeans expression (invlogit(predict(xb)))
only factor variables and their interactions are allowed
Comment