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

# Re: st: margins: (not estimatable)

 From D-Ta To statalist@hsphsun2.harvard.edu 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<altruist81@gmx.de>  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
(http://www.stata.com/statalist/archive/2011-06/msg00407.html), 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 i.fail##(c.mc_1st##c.mc_1st##c.mc_1st) if  sex==0,
vce(cluster mc_1st)

(output omitted)

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

Conditional marginal effects                      Number of obs   =
409
Model VCE    : Robust

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

------------------------------------------------------------------------------
|            Delta-method
|      dy/dx   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
1.fail |  (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.

--Jeff
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

```
```*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```