Announcement

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

  • comparing the logit marginal effects to LPN coefficient

    Dear Stata users,
    I am using a logit model to calculate the average marginal effect (AME) of my independent variables on a dichotomous dummy variable (completed education VS non-completed education). Independent variables: 1.gen immigrant, 2.gen immigrant. I am comparing the logit marginal effects to the coefficient obtained by a linear probability model using OLS. The differences in percent points between the natives and the two immigrant group are not similar in these to analysis (AME from logit and coefficient from LPN). Are not the marginal effects from the logit models comparable to the OLS coefficients from the linear probability model? I dont, undersatnd why I get different results?
    All the best,
    Sunniva

  • #2
    Please show data (if possible), commands, and results you are asking about.

    Comment


    • #3
      Please find the results below:

      OLS (LPN)
      1.gen -0.064254
      2.gen -0.105847
      constant 0.88476

      LOGIT:
      1.gen -0.518517
      2.gen -0.778956
      constant 2.038298

      AME after logit:
      dydx
      1.gen -0.056208
      2.gen -0.084441
      As you see from the results AME after logit gives differnt estimates comaped to LPN.
      Last edited by Sunniva; 27 Oct 2021, 06:25.

      Comment


      • #4
        If you have a single categorical variable, then the coefficients should not be just similar but exactly the same, as it is a saturated model. The standard errors are different, as it is a different estimator, but the coefficients are exactly the same, as you can see in the example below.

        Code:
        . // open example data
        . sysuse nlsw88, clear
        (NLSW, 1988 extract)
        
        .
        . // prepare the data
        .
        . gen byte occat = cond(occupation < 3, 1,                    ///
        >                  cond(inlist(occupation,5, 6, 8, 9), 2, 3)) ///
        >                  if !missing(occupation)
        (9 missing values generated)
        
        . label variable occat "occupational category"
        
        . label define occat 1 "white collar" ///
        >                    2 "skilled"      ///
        >                    3 "unskilled"
        
        . label value occat occat
        
        .
        . // estimate the logit with AMEs
        . qui logit union i.occat
        
        . margins, dydx(*)
        
        Conditional marginal effects                             Number of obs = 1,869
        Model VCE: OIM
        
        Expression: Pr(union), predict()
        dy/dx wrt:  2.occat 3.occat
        
        ------------------------------------------------------------------------------
                     |            Delta-method
                     |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
               occat |
            skilled  |   .1024781   .0266427     3.85   0.000     .0502593    .1546969
          unskilled  |   .1022039   .0224706     4.55   0.000     .0581624    .1462455
        ------------------------------------------------------------------------------
        Note: dy/dx for factor levels is the discrete change from the base level.
        
        .
        . // estimate the LPM
        . reg union i.occat
        
              Source |       SS           df       MS      Number of obs   =     1,869
        -------------+----------------------------------   F(2, 1866)      =     10.39
               Model |  3.81797888         2  1.90898944   Prob > F        =    0.0000
            Residual |  342.966398     1,866  .183797641   R-squared       =    0.0110
        -------------+----------------------------------   Adj R-squared   =    0.0099
               Total |  346.784377     1,868  .185644741   Root MSE        =    .42872
        
        ------------------------------------------------------------------------------
               union | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
               occat |
            skilled  |   .1024781   .0276142     3.71   0.000     .0483201    .1566361
          unskilled  |   .1022039   .0239401     4.27   0.000     .0552517    .1491562
                     |
               _cons |   .1710262   .0192306     8.89   0.000     .1333105    .2087418
        ------------------------------------------------------------------------------
        If you have other explanatory/control variables in your model, then the result will differ somewhat. Differences in results you have shown would be a bit high, but still within the limits of what I would expect.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Well, you should not expect the LPM coefficients to match AMEs, exactly. Why would you? The mathematics are vastly different. OLS analytically minimizes the sums of squares; AMEs approximate a linear change in a non-linear model by averaging predictions at observed covariate values.

          I would say, 5.6 percentage points are pretty close to 6.4 percentage points (the CIs will probably overlap); so are 8.4 p.p. and 10.6 p.p. But that judgment obviously depends on the context. If you tell us more about why you are asking those questions, we might be able to give advice.

          Edit:

          Maarten provides a much more elaborate answer. I was assuming that there are additional covariates, which I really cannot tell from what you have (not) shown.
          Last edited by daniel klein; 27 Oct 2021, 07:01.

          Comment


          • #6
            Many thanks, this was very helpful.

            Comment


            • #7
              As to differences that might or might not be expected, I use Maartens example and add a single continuous covariate (and change the link-functin for the non.linear model) to obtain:

              Code:
              . 
              . estimates table AME_logit LPM AME_probit
              
              -----------------------------------------------------
                  Variable | AME_logit       LPM       AME_probit  
              -------------+---------------------------------------
                     occat |
                  skilled  |  .19039135    .20256645    .18547717  
                unskilled  |  .14882826    .16475509    .14462052  
                           |
                      wage |  .02111908    .02286942    .02131575  
                     _cons |              -.05758609               
              -----------------------------------------------------

              Comment


              • #8
                Many thanks for your help. There are no other covariates in my model, so then my results shold be exactly the same in the LPN and AME after logit, or have I misunderstood?

                Comment


                • #9
                  Originally posted by Sunniva View Post
                  There are no other covariates in my model, so then my results shold be exactly the same in the LPN and AME after logit
                  Yes. If the results differ, something is wrong. Because you did neither show the code you used nor the complete output, we cannot tell what is wrong.

                  btw. it is LPM, the M stands for model.

                  Comment


                  • #10
                    I apologize for the typo error in my post, yes it should be LPM.
                    We no discovered that the reason for why we get different results in the two models is because we have used a marginal effect at the mean (MEM) and not AME. Thanks for useful help.

                    Comment

                    Working...
                    X