Announcement

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

  • ivprobit twostep command - intuition?

    Hi all,
    Is the
    HTML Code:
    ivprobit, twostep
    command appropriate if I want to:

    (1) estimate an endogenous regressor x using an instrument variable z - using OLS
    (2) use x_hat to then estimate for dummy dependant variable y, using probit (because it is a binary dummy variable)

    Many thanks

  • #2
    Newey's procedure involves running a linear regression model where the endogenous variable is the outcome and the instruments and other independent variables are regressors, predicting the residuals and including these as a regressor in a second stage probit model. This is the estimator implemented by specifying the -twostep- option. His article (linked below) outlines the intuition.

    Reference
    Newey, W. (1987). "Efficient estimation of limited dependent variable models with endogenous explanatory variables." Journal of Econometrics, 36: 231-250.

    Code:
    webuse laborsup, clear
    
    *IVPROBIT -TWOSTEP-
    ivprobit fem_work fem_educ kids (other_inc = male_educ), twostep
    
    *NEWEY'S PROCEDURE: FIRST STAGE REGRESSION
    regress other_inc fem_educ kids male_educ
    
    *PREDICT RESIDUALS
    predict res, r
    
    *SECOND STAGE PROBIT (SEs NOT CORRECTED FOR 2 STAGE ESTIMATION)
    probit fem_work other_inc fem_educ kids res
    Res.

    Code:
    . *IVPROBIT -TWOSTEP-
    
    .
    . ivprobit fem_work fem_educ kids (other_inc = male_educ), twostep
    Checking reduced-form model...
    
    Two-step probit with endogenous regressors        Number of obs   =        500
                                                      Wald chi2(3)    =      93.97
                                                      Prob > chi2     =     0.0000
    
    ------------------------------------------------------------------------------
                 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
       other_inc |   -.058473   .0093364    -6.26   0.000    -.0767719    -.040174
        fem_educ |    .227437   .0281628     8.08   0.000     .1722389     .282635
            kids |  -.1961748   .0496323    -3.95   0.000    -.2934522   -.0988973
           _cons |   .3956061   .4982649     0.79   0.427    -.5809752    1.372187
    ------------------------------------------------------------------------------
    Instrumented:  other_inc
    Instruments:   fem_educ kids male_educ
    ------------------------------------------------------------------------------
    Wald test of exogeneity: chi2(1) = 6.50                   Prob > chi2 = 0.0108
    
    .
    .
    . *NEWEY'S PROCEDURE: SECOND STAGE PROBIT (SEs NOT CORRECTED FOR 2 STAGE ESTIMATION)
    
    .
    . probit fem_work other_inc fem_educ kids res
    
    Iteration 0:   log likelihood = -344.63508  
    Iteration 1:   log likelihood = -252.10819  
    Iteration 2:   log likelihood = -252.04529  
    Iteration 3:   log likelihood = -252.04529  
    
    Probit regression                                       Number of obs =    500
                                                            LR chi2(4)    = 185.18
                                                            Prob > chi2   = 0.0000
    Log likelihood = -252.04529                             Pseudo R2     = 0.2687
    
    ------------------------------------------------------------------------------
        fem_work | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
       other_inc |   -.058473   .0090228    -6.48   0.000    -.0761573   -.0407887
        fem_educ |    .227437   .0273171     8.33   0.000     .1738964    .2809775
            kids |  -.1961748   .0478084    -4.10   0.000    -.2898776    -.102472
             res |   .0240492   .0094295     2.55   0.011     .0055677    .0425306
           _cons |   .3956061   .4784993     0.83   0.408    -.5422352    1.333448
    ------------------------------------------------------------------------------
    
    .
    Last edited by Andrew Musau; 26 Sep 2022, 15:30.

    Comment


    • #3
      Thank you for the well explained response Andrew.

      So, if I am correct in understanding, you need to run all four lines of code specified, with the final output as you have shown being probit regression ?

      Would I then need to run -margins- to get the marginal effect at the mean?

      Comment


      • #4
        No need to run the estimation in several steps, this is already programmed into ivprobit. I would recommend using the maximum likelihood estimator. The requirement is that the outcome is binary, but the endogenous variable must be continuous. Then, you indeed can use margins, same as you would do when estimating a probit model.

        Code:
        webuse laborsup, clear
        ivprobit fem_work fem_educ kids (other_inc = male_educ)
        margins, dydx(fem_educ) predict(pr)
        So this, e.g., gives you the average marginal effect of female education on probability that a woman works.


        Code:
        . ivprobit fem_work fem_educ kids (other_inc = male_educ)
        
        Fitting exogenous probit model
        
        Iteration 0:   log likelihood = -344.63508  
        Iteration 1:   log likelihood = -252.10819  
        Iteration 2:   log likelihood = -252.04529  
        Iteration 3:   log likelihood = -252.04529  
        
        Fitting full model
        
        Iteration 0:   log likelihood = -2368.2142  
        Iteration 1:   log likelihood = -2368.2062  
        Iteration 2:   log likelihood = -2368.2062  
        
        Probit model with endogenous regressors                 Number of obs =    500
                                                                Wald chi2(3)  = 163.88
        Log likelihood = -2368.2062                             Prob > chi2   = 0.0000
        
        ----------------------------------------------------------------------------------------------
                                     | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -----------------------------+----------------------------------------------------------------
                           other_inc |  -.0542756   .0060854    -8.92   0.000    -.0662028   -.0423485
                            fem_educ |    .211111   .0268648     7.86   0.000     .1584569    .2637651
                                kids |  -.1820929   .0478267    -3.81   0.000    -.2758315   -.0883542
                               _cons |   .3672086   .4480724     0.82   0.412    -.5109971    1.245414
        -----------------------------+----------------------------------------------------------------
         corr(e.other_inc,e.fem_work)|   .3720375   .1300518                      .0946562    .5958136
                      sd(e.other_inc)|   16.66621   .5270318                      15.66461    17.73186
        ----------------------------------------------------------------------------------------------
        Instrumented:  other_inc
        Instruments:   fem_educ kids male_educ
        ----------------------------------------------------------------------------------------------
        Wald test of exogeneity (corr = 0): chi2(1) = 6.70        Prob > chi2 = 0.0096
        
        .
        . margins, dydx(fem_educ) predict(pr)
        
        Average marginal effects                                   Number of obs = 500
        Model VCE: OIM
        
        Expression: Average structural function probabilities, predict(pr)
        dy/dx wrt:  fem_educ
        
        ------------------------------------------------------------------------------
                     |            Delta-method
                     |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
            fem_educ |   .0646175   .0073529     8.79   0.000      .050206     .079029
        ------------------------------------------------------------------------------
        
        .
        Last edited by Andrew Musau; 26 Sep 2022, 16:22.

        Comment


        • #5
          No need to run the estimation in several steps, this is already programmed into ivprobit.
          Got it. I understand now you were just breaking it down if you did each step manually.

          My regression fits
          The requirements are that the outcome is binary, but the endogenous variable and instruments must be continuous.
          Many thanks for you help!

          Comment


          • #6
            Andrew Musau I urgently need your help. Hoping to get positive response from you.

            I am doing probit model where i am using an instrument. My dependent variable in vocational training which is a dummy (0 and 1) and have list of regressors. One of my regressors is remittance (remitt) which I suspect as endogenous. That's why I am using an instrument which is nonfarm (whether hh owns any nonfarm entrepreneurship) which is also a dummy (0 and 1). I have run the following regression:

            Code:
            ivprobit vocationaltraining hhsize gender literacy uneduc_adults mfs_use loan scatosavings scatoassets mobile1 barisal chittagong khulna rajshahi rangpur sylhet members_in_agri agrishock distfacility3 (remitt = nonfarm), twostep
            The output looks like this:

            Code:
            
            
            Two-step probit with endogenous regressors        Number of obs   =     18,366
                                                              Wald chi2(19)   =     333.32
                                                              Prob > chi2     =     0.0000
            
            ---------------------------------------------------------------------------------
                            |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            ----------------+----------------------------------------------------------------
                     remitt |  -1.510386   .3144558    -4.80   0.000    -2.126708   -.8940643
                     hhsize |  -.0329519   .0101655    -3.24   0.001    -.0528759   -.0130279
                     gender |  -.8139006   .1565242    -5.20   0.000    -1.120683   -.5071187
                   literacy |   .0023912   .0166741     0.14   0.886    -.0302895    .0350718
              uneduc_adults |  -.0912452   .0228638    -3.99   0.000    -.1360574   -.0464329
                    mfs_use |   .1571294   .0352415     4.46   0.000     .0880574    .2262014
                       loan |  -.0105326   .0366643    -0.29   0.774    -.0823934    .0613282
               scatosavings |  -.0001195   .0000965    -1.24   0.216    -.0003086    .0000697
                scatoassets |   .0000167   5.51e-06     3.04   0.002     5.95e-06    .0000275
                    mobile1 |   .1492968   .0155468     9.60   0.000     .1188257     .179768
                    barisal |     .03892   .0667708     0.58   0.560    -.0919483    .1697883
                 chittagong |  -.0186855   .0620932    -0.30   0.763    -.1403859    .1030149
                     khulna |   -.121161   .0584884    -2.07   0.038    -.2357961   -.0065259
                   rajshahi |  -.0558219   .0584396    -0.96   0.339    -.1703615    .0587176
                    rangpur |  -.1035035   .0597487    -1.73   0.083    -.2206088    .0136018
                     sylhet |   .0893287   .0466704     1.91   0.056    -.0021436     .180801
            members_in_agri |  -.1848795   .0312157    -5.92   0.000     -.246061   -.1236979
                  agrishock |   .0635239   .0460319     1.38   0.168    -.0266969    .1537448
              distfacility3 |   .0002565   .0033592     0.08   0.939    -.0063274    .0068404
                      _cons |  -.3183147   .2404636    -1.32   0.186    -.7896148    .1529854
            ---------------------------------------------------------------------------------
            Instrumented:  remitt
            Instruments:   hhsize gender literacy uneduc_adults mfs_use loan scatosavings
                           scatoassets mobile1 barisal chittagong khulna rajshahi rangpur
                           sylhet members_in_agri agrishock distfacility3 nonfarm
            ---------------------------------------------------------------------------------
            Wald test of exogeneity: chi2(1) = 23.97                  Prob > chi2 = 0.0000
            
            . 
            end of do-file
            
            . 
            
            
            .

            Now my questions are:

            1. Have I run the regression correctly?
            2. Can I use two step?
            3. To get the marginal effect do I need to run "margins, dydx(*) post"?
            4. How to know whether my model has endogeneity or not?
            5. and last how to know whether my instrument is strong or weak?


            Thank You.

            Comment


            • #7
              As far as I see, yes to 1-3. For 4, at the foot of the table, you have a test of endogeneity of the instrumented regressor. If the test statistic is significant, you reject the null of exogeneity. For 5, check this by estimating the linear IV model as the reduced form is linear.

              Comment

              Working...
              X