Announcement

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

  • Reading Margins with a Logit Link

    Hello Statalist,

    I have been going back-and-forth with the margins command for a couple of weeks, and I'm hoping someone can help me out.

    I have a dependent variable that is a proportion, and I'm using a generalized estimating equation (xtgee) with a logit link (fractional proportion model). I would like to do some post-estimation commands, and have been trying to delve into the margins command. My understanding is that marginal effects are computed differently with continuous and discrete variables, but is this in reference to the dependent or independent variables (or both)? What confuses me is that my dependent variable is not binary, but uses a logit-link. I've noticed that a lot of examples online use
    Code:
    margins dyex
    with probit and logit models (I'm not sure if that means anything, just something that I noticed).

    So, I guess, my first question is if I use margins command with a logit-link, do I interpret the results as probabilities, even though the DV is not binary? As an example:
    Code:
    xtgee y x1 i.x2 i.x3, family(binomial 1) link(logit) corr(exchangeable) vce(robust)
    
    Iteration 1: tolerance = .17098922
    Iteration 2: tolerance = .00279107
    Iteration 3: tolerance = .00019978
    Iteration 4: tolerance = .00001054
    Iteration 5: tolerance = 5.749e-07
    
    GEE population-averaged model                   Number of obs      =     37318
    Group variable:                       dyad      Number of groups   =      6416
    Link:                                logit      Obs per group: min =         1
    Family:                           binomial                     avg =       5.8
    Correlation:                  exchangeable                     max =        12
                                                    Wald chi2(3)       =    184.71
    Scale parameter:                         1      Prob > chi2        =    0.0000
    
                                       (Std. Err. adjusted for clustering on dyad)
    ------------------------------------------------------------------------------
                 |               Robust
               y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
              x1 |  -.0404904   .0055453    -7.30   0.000    -.0513589   -.0296219
            1.x2 |  -.5259211   .0511197   -10.29   0.000    -.6261138   -.4257283
            1.x3 |   .0621003   .0310888     2.00   0.046     .0011673    .1230333
           _cons |  -.7179048   .0466042   -15.40   0.000    -.8092474   -.6265622
    ------------------------------------------------------------------------------
    Code:
     margins, dydx(*) atmeans
    
    Conditional marginal effects                      Number of obs   =      37318
    Model VCE    : Robust
    
    Expression   : Pr(y != 0), predict()
    dy/dx w.r.t. : x1 1.x2 1.x3
    at           : x1              =    4.091095 (mean)
                   0.x2            =    .1331797 (mean)
                   1.x2            =    .8668203 (mean)
                   0.x3            =    .9177073 (mean)
                   1.x3            =    .0822927 (mean)
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
              x1 |  -.0066807    .000908    -7.36   0.000    -.0084604   -.0049011
            1.x2 |  -.0963759   .0101107    -9.53   0.000    -.1161925   -.0765594
            1.x3 |   .0104013   .0052827     1.97   0.049     .0000474    .0207552
    ------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    The unit of analysis is directed dyad year (dyad=countries) and y is asylum rate (as a proportion) and x2 is a binary variable whether the country granting asylum is a democracy (coded as 1) or not (coded as 0).

    Does this read, that the probability of getting asylum is 9.6 percentage points less than in a non-democratic country?

    x 3 regards if there's an election being held in the country granting asylum (binary 1=y, 0=n). So, how would the "9.6 percentage points of being less likely to be granted asylum compared to a non-democratic" read with average mean value when there is a national election (1.x3 = .0822927 (mean) and assuming I read "1.x2 | -.0963759" correctly).

    (Also, I still haven't figured out what the expression "Expression : Pr(y != 0), predict()" means...)

    Apologies if this question has been exhausted, I just having a hard time cracking through margins given 1) fractional logit equation 2) independent variables that are dummy variables. That being said, I'm also open to better/clearer post estimation commands given xtgee with a logit link if anyone thinks that, perhaps, margins may not be really suitable (again, not sure, but trying to keep an open-mind). Thank you in advance for any help.

  • #2
    As an update, I realize that margin effects at the means may not be the best approach with these variables, and instead average adjusted predictions or average marginal affects will suffice. But I'm still curious with most of the questions that I asked, with the exception of
    x 3 regards if there's an election being held in the country granting asylum (binary 1=y, 0=n). So, how would the "9.6 percentage points of being less likely to be granted asylum compared to a non-democratic" read with average mean value when there is a national election (1.x3 = .0822927 (mean) and assuming I read "1.x2 | -.0963759" correctly).

    Comment


    • #3
      update 2: (courtesy update) This was cross-posted to stack.exchange at: https://stats.stackexchange.com/ques...-link-function

      Comment


      • #4
        Monica: You're interpretation is almost correct, but you're not estimating a probability. You're estimating an expected value. So if your dependent variable is the proportion of people receiving asylum (I'm guessing here), then when x2 goes from zero to one you estimate that the percent of people getting asylum goes falls by 9.6 percentage points. You're estimating the expected value of y at x2 = 1 and x2 = 0 and taking the difference. You're plugging in the averages of the other explanatory variables by using atmeans. I agree that it is better to drop this option and then you'll be computing the true average partial effect.

        Oh, and just ignore "Expression : Pr(y != 0), predict()." I think this is a holdover from when only binary models were allowed. This should be ignored, as it implies that y is being turned into a zero-one variable. I don't think this is true. I certainly hope not.

        JW

        Comment


        • #5
          Originally posted by Jeff Wooldridge View Post
          Monica: You're interpretation is almost correct, but you're not estimating a probability. You're estimating an expected value. So if your dependent variable is the proportion of people receiving asylum (I'm guessing here), then when x2 goes from zero to one you estimate that the percent of people getting asylum goes falls by 9.6 percentage points. You're estimating the expected value of y at x2 = 1 and x2 = 0 and taking the difference. You're plugging in the averages of the other explanatory variables by using atmeans. I agree that it is better to drop this option and then you'll be computing the true average partial effect.

          Oh, and just ignore "Expression : Pr(y != 0), predict()." I think this is a holdover from when only binary models were allowed. This should be ignored, as it implies that y is being turned into a zero-one variable. I don't think this is true. I certainly hope not.

          JW
          Professor Wooldridge,

          Thank you for taking the time to reply. Like I mentioned, I was getting very confused between reading margins, the DV, and using xtgee and with logit link. But it makes perfect sense now after reading your reply. Thank you again. It's a lot clearer now.

          And I certainly hope you're correct with regards to the expression! (Though, I am sure that is the case).

          (As a side note, thanks also to Professor Richard Williams if you come across this thread. I still have some questions with margins, but your articles and powerpoint slides are very helpful).

          Comment


          • #6
            Monica: Let me also recommend just doing a pooled estimation to be sure you get somewhat similar marginal effects. I've used both pooled estimation and xtgee in past applications and have gotten similar results -- which is why I think xtgee is doing the correct thing and leaving the response as a fraction.

            Code:
             
             glm y x1 i.x2 i.x3, family(binomial 1) link(logit) vce(cluster id)

            Comment


            • #7
              Originally posted by Jeff Wooldridge View Post
              Monica: Let me also recommend just doing a pooled estimation to be sure you get somewhat similar marginal effects. I've used both pooled estimation and xtgee in past applications and have gotten similar results -- which is why I think xtgee is doing the correct thing and leaving the response as a fraction.

              Code:
              glm y x1 i.x2 i.x3, family(binomial 1) link(logit) vce(cluster id)
              Professor Wooldridge,

              When I ran both estimations (xtgee and glm) with the full model, the xtgee coefficients were different than the glm. There were also a few variables that were different in terms of directionality and level of significance. If you have gotten similar results, then perhaps there is something wrong with my model.

              The only thing off the top of my head that I can pinpoint is something that we had talked about before which is a small T, large N (http://www.statalist.org/forums/foru...ndent-variable).

              Comment

              Working...
              X