Announcement

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

  • Is this the correct Stata syntax for CF/2SRI with an ordinal probit in the first stage?

    Dear All,

    I am mostly an R user. But since I have not found a way yet to reproduce generalised residuals in R (link), I am using Stata for my estimation.

    The jist is as follows: I run an oprobit on my ordinal EEV, I get the generalised residual (apparently that is just one residual per observation, instead of on per level?). I add the residual with the EEV in the second stage. And finally I calculate the AME/APE.

    ordinal_var is an ordinal variable with four levels
    depvar is the dependent variable with values ranging between (and including) 0 and 1.

    Code:
     oprobit ordinal_var instrumentalvar1 instrumentalvar2
      drop residual
      predict residual, score
      fracreg logit depvar i.ordinal_var residual, vce(robust)
      margins(ordinal_var)
    One reason I am posting this, is because I was a little bit surprised about the output from margins(ordinal_var). Everything looks a little bit weird. Crazy significant, but there is hardly any difference in the effect of all of the levels. Also, I was kind of expecting three marginal effects and not 4.

    Could anyone let me know if there is anything wrong with my code?


    Code:
      ----------------------------------------------------------------------------------
                       |                Delta-method
                       |    Margin     Std. Err.    z     P>|z|        [95% Conf. Interval]
      -----------------+----------------------------------------------------------------
      ordinal_var|
                    0  |   .8752151   .0098138    89.18   0.000     .8559803    .8944498
                    1  |   .8434355   .0045137    186.86  0.000     .8345888    .8522822
                    2  |   .8412551   .0091412    92.03   0.000     .8233386    .8591716
                    3  |   .8268829   .0203199    40.69   0.000     .7870567    .8667091
      ----------------------------------------------------------------------------------


    References:

    Chiburis, R., & Lokshin, M. (2007). Maximum Likelihood and Two-Step Estimation of an Ordered-Probit Selection Model. The Stata Journal, 7(2), 167–182. https://doi.org/10.1177/1536867X0700700202

    Terza J. V, Basu A., Rathouz, P.J. (2008) Two-stage residual inclusion estimation: addressing endogeneity in health econometric modeling. Journal of health economics 27 (3), 531-543, 2008

    Vella, F. (1993). A Simple Estimator for Simultaneous Models with Censored Endogenous Regressors. International Economic Review, 34(2), 441-457. doi:10.2307/2526924

    Wooldridge,JM. (2014) Quasi-maximum likelihood estimation and testing for nonlinear models with endogenous explanatory variables. Journal of Econometrics Volume 182, Issue 1, September 2014, Pages 226-234


  • #2
    One correction on the following part:
    Also, I was kind of expecting three marginal effects and not 4.
    I actually meant that I was expecting one negative effect and three positive. I don't really understand how every level of an ordinal variable can have more or less the same effect. That would be the same as it having no effect (because the effect is not dependent on the level).

    Comment


    • #3
      Hi Tom
      So, your application of the 2SRI is correct. But the estimation of the standard errors needs additional correction.
      The easiest way to fix that is using a twostage bootstrap:
      Code:
      program fraciv
          oprobit ordinal_var instrumentalvar1 instrumentalvar2   drop residual
          capture drop residual
          predict residual, score
          fracreg logit depvar i.ordinal_var residual, vce(robust)
      end
      Now, regarding the interpretation, there is nothing wrong with how you estimated margins, Except that they may not be what you are trying to identify.
      what you did is to estimate predicted means. Meaning, what is the average predicted "depvar" for the different levels of "ordinal_var". Its the differences across those that would identify the "marginal effect"

      The more usual way (which may be what you wanted) is to type

      Code:
      margins,  dydx(ordinal_var)
      HTH

      Comment


      • #4
        FernandoRios Thank you very much for your answer! This is really helpful!

        Comment


        • #5
          FernandoRios I am super happy with the bootstrap, but I am struggling a little bit with implementing it.
          I'm a bit of Stata noob (I usually use R, which is why I was desperately trying to figure out the formula for generalised residuals, because they are not available in R at the moment).

          When I run the code as you wrote it, I assume I created a function. I then tried to do this:

          Code:
          simulate rmse=r(rmse), reps(100) seed(12345): boostrap
          variable drop not found
          an error occurred when simulate executed boostrap
          r(111);
          So I assume you maybe intended to write:

          Code:
          program fraciv
               oprobit ordinal_var instrumentalvar1 instrumentalvar2
               capture drop residual
               predict residual, score
               fracreg logit depvar i.ordinal_var residual, vce(robust)
          end
          With this code I can run the simulation.

          But then I'm a bit lost.. How do I get any output from this?

          Comment


          • #6
            Use -bootstrap- (-help bootstrap-); and refer to new program "fraciv" when you call it

            Comment


            • #7
              My bad
              the last piece of code with my program was

              bootstrap: fraciv

              that will do the bootstrap of the program fraciv

              Comment


              • #8
                Thank you very much! It works smoothly now.

                Comment

                Working...
                X