Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: margins: (not estimatable)

From   D-Ta <>
Subject   Re: st: margins: (not estimatable)
Date   Mon, 18 Jul 2011 10:25:51 +0200

Wonderful, thanks for your support!!

Am 13.07.2011 21:09, schrieb Jeff Pitblado, StataCorp LP:
Darjusch<>  is using -margins- after a -logit- model that
contains the interaction of a single factor variable with the linear,
quadratic, and cubic terms of a continuous variable and is getting the
'(not estimable)' label in the -margins- output:

I have read a similar thread
(, but the
answer wouldnt solve my problem, I run a logit model where I am
interested in the marginal effect of fail (dummy) on dropout at the
value of mc_1styr_c==0 (the model is based on a regression discontinuity
research design).

Here is what I do:

. logit dropout3_en if  sex==0,
vce(cluster mc_1st)

(output omitted)

. margins ,dydx(fail) at(mc_1st==0)

Conditional marginal effects                      Number of obs   =
Model VCE    : Robust

Expression   : Pr(dropout3_enrollment), predict()
dy/dx w.r.t. :
at           : mc_1styr_c~d    =           0

               |            Delta-method
               |      dy/dx   Std. Err.      z    P>|z|     [95% Conf.
-------------+---------------------------------------------------------------- |  (not estimable)
Note: dy/dx for factor levels is the discrete change from the base level.

The command: margins ,dydx(fail) at(mc_1st==0) should give me the effect
and the significance level of interest. If I enlarge the sample (lets
say, not condition on sex==0) it works.

Could someone explain me the core of the problem and how to solve it?

The check for 'Estimable functions' performed by -margins- is detailed in the
methods and formulas section of -[R] margins-.

The basic idea here is that -logit- saves off a hidden matrix, let's call it
H, that -margins- uses to check for estimable functions.  This H matrix should
only contain values -1, 0, and 1.  The check is as follows

	z*b is estimable if z = z*H

where b is the coefficient vector, and z a vector of fixed/hypothetical values
of the independent variables in the fitted model. -margins- compares z and z*H
via relative differences with a numeric tolerance of 1e-5, controlable via the
-estimtolerance()- option.

We suspect that the cubic polynomial in Darjusch's fitted -logit- model is
causing the H matrix to have values outside -1, 0, and 1.  This can happen
with numerically unstable calculations due to huge scale differences between
the independent variables, otherwise caused by the result of the propagation
of errors in the finite precision calculations.

Darjusch can verify if there are problems with the H matrix by typing the
following Stata commands after the -logit- model fit:

	. matrix H = get(H)
	. matrix list H

If the output has values other than -1, 0, and 1, Darjusch can use the
-noestimcheck- option with -margins- to prevent the estimability check.  We
feel confident in giving Darjusch this advice in this case since there is only
one factor variable in the model specification, and the polynomial terms of
the continuous variable should not, in theory assuming infinite precision
calculations, result in non-estimable functions.

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index