Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using margins after meglm - How to get the marginal effects after a multi-level model estimated with meglm (works with logit but not meglm)?

    Dear all,

    I want to obtain the marginal effects after estimating a (logit) multi-level model using the meglm command.

    The problem I am facing is that I receive the following error message when estimating the multi-level model but NOT when using a (single-level) logit with cluster robust standard errors (clustered at the higher level2)
    Code:
    could not calculate numerical derivatives -- discontinuous region with missing values
    encountered
    r(459);
    While this works...
    Code:
    logit Z $controls c.A##c.B  , vce(cluster HigherLevel) or      
    quietly margins, at(A =(-0.9(1)3.2) B=(-1.2(1)3.2)) saving(predictions1, replace)

    ...this doesn't:
    Code:
    meglm Z $controls c.A##c.B   || HigherLevel: ,  family(binomial) link(logit)  intpoints(14) or
    quietly margins, at(A =(-0.9(1)3.2) B=(-1.2(1)3.2)) saving(predictions2, replace)
    The model is specified correctly, so I am suspecting it is related to the random part of the MLM, but I am not sure what to do about or where exactly the problem is rooted.
    I would be greatful for any hints!!

    Thank you in advance!
Working...
X