2
$\begingroup$

The accepted answer of this question seems to indicate that the z-value of the margin is the same as the z-value of the coefficient in the logit model. This, it seems, is true with how Stata calculates the standard deviation for the margins with the delta method.

The question emerged from Stata output, but I'm interested in the general issue of calculating the t-value for the margins.

Setup

Let's define some terms. Suppose I run a logit for the probability of $y = 1$ on $x_1, x_2$. Let the logit estimates be $\hat{\beta}_1, \hat{\beta}_2$ and let the logit link function $f()$ be:

$$ f = {1 \over 1+ exp(-x\beta)}$$

I'm not sure how Stata calculates the default margin, but (looking at the documentation, p. 50)[https://www.stata.com/manuals13/rmargins.pdf#rmargins] it seems that the marginal effect is calculated at every point and then averages.

Margins for $X_1$

Thus the margin for $x_1$ would be calculated as a sum over all observations:

$$\hat{p}_1 = {1 \over N} \sum_{i=1}^N h_1(x_i, \hat{\beta}) $$

where

$$h(x_i, \hat{\beta}) ={ \partial f(x, \hat{\beta}) \over \partial x_1 } $$

Calculation of T values / z-score

the z-score would be the t-value of the hypothesis that the coefficient or the margin is zero.

For the logit coefficients

$$ z-score = { \hat{\beta_1} \over \sqrt{\hat{V}}_{1, 1} }$$

where $\hat{V}$ is the asymptotic variance that comes from the general maximum likelihood estimation problem.

For the margins

If we use the delta-method, then I think it should be:

$$ z-score = { \hat{p}_1 \over \sqrt{[\hat{p}_1']^2 \hat{V}} }$$

where the derivative of $\hat{p}_1$ is taken with respect to $\beta_1$ in this example.

Let me know if my notation or definitions have any issues and I'll correct it so the question becomes clearer, thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

The z-score for the AME will not be the same as the one for the coefficient, though they are calculated in a very similar way by subtracting zero and dividing by the standard error.

Here's an example showing this calculation with Stata for a continuous variable. I won't calculate the standard error of the average marginal effect (AME) by hand since the derivative gets messy. I will calculate the AME by hand below:

. sysuse auto, clear
(1978 Automobile Data)

. logit foreign turn, nolog

Logistic regression                             Number of obs     =         74
                                                LR chi2(1)        =      37.46
                                                Prob > chi2       =     0.0000
Log likelihood = -26.304932                     Pseudo R2         =     0.4159

------------------------------------------------------------------------------
     foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        turn |  -.5348965   .1266865    -4.22   0.000    -.7831976   -.2865955
       _cons |    19.4745   4.684576     4.16   0.000      10.2929     28.6561
------------------------------------------------------------------------------

. display "Coefficient z-score = " (_b[turn]- 0)/_se[turn]
Coefficient z-score = -4.2222053

. gen double ME = [exp(_b[_cons] + _b[turn]*turn)/(1 + exp(_b[_cons] + _b[turn]*turn))]*[1-exp(_b[_cons] + _b[turn]*turn)/(1 + exp(_b[_cons] + _b[turn]*turn))]*_b[turn]

. sum ME

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
          ME |         74    -.060656    .0487965  -.1321447  -.0002178

. margins, dydx(turn) post

Average marginal effects                        Number of obs     =         74
Model VCE    : OIM

Expression   : Pr(foreign), predict()
dy/dx w.r.t. : turn

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        turn |   -.060656   .0041576   -14.59   0.000    -.0688048   -.0525072
------------------------------------------------------------------------------

. display "AME z-score = " (_b[turn]- 0)/_se[turn]
AME z-score = -14.589033
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.