Announcement

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

  • Dummy endogenous regressor cmp

    Dear Statalist members,

    I am trying to estimate a model with two endogenous regressors-- one dummy (x1) and another continuous (x2) -- and two instruments z1 and z2. The outcome variable y is continuous
    I believe that I could just use the following stata command if both the endogenous variables x1 and x2 were continuous. $controls is a set of control variables

    ivregress 2sls y $controls (x1 x2 = z1 z2)

    But, with a dummy endogenous variable both ivregress and ivprobit commands seem inappropriate. So, I was wondering if David Roodman's cmp command would be appropriate in this situation, and if so, if the codes below are correctly specified for estimating a model with two endogenous regressors.

    setup cmp
    cmp (y = $controls x1 x2) (x1= $controls z1 z2) (x2 = $controls z1 z2), ind($cmp_cont, $cmp_probit, $cmp_probit)

    Please suggest!

  • #2
    ivregress also works. This is discussed in the cmp help file. Look for "Kelejian". cmp makes stronger assumptions and is more precise if the assumptions are right. Also see discussion of this issue in Roodman and Morduch.

    Comment


    • #3
      Thanks David! What about when the outcome variable y is binary as well? Would you recommend using cmp in such case? Is the following cmp code appropriate when you have binary y, binary x1 and continuous x2?
      cmp (y = $controls x1 x2) (x1= $controls z1 z2) (x2 = $controls z1 z2), ind($cmp_probit, $cmp_probit, $cmp_cont)

      Comment


      • #4
        Yes that code is appropriate, but take the commas out of the ind() option.
        Even with a binary dependent variable, a pure linear model is still viable--it's called a linear probability model. Both ways are valid.

        Comment


        • #5
          Hi,
          I found this thread very helpful, since I am trying apply the case of a binary y with binary x1 and continuous x2 with 4 instruments z1-z4. I used the cmp command suggested by Mikey, after removing the commas out of the ind() option per David's remark on my data. I am using Stata 11.1.
          The output provides me with the following warning for both endogenous regressors:
          "Warning: regressor matrix for x1 equation appears ill-conditioned. (Condition number = 153.04998.) This might prevent convergence. If it does, and if you have not done so already, you may need to remove nearly collinear regressors to achieve convergence. Or you may need to add a nrtolerance(#) or nonrtolerance option to the command line"
          I tried adding the nontolerance option but convergence is still not reached.
          Should I be looking at collinearity only between my explanatory variables, or should I include possible collinearity between them and the IVs?
          Any suggestion would be much appreciated.
          Many thanks,
          Yaara
          Last edited by Yaara Nussi; 18 Jun 2016, 06:26. Reason: I realized I have not mentioned using Stata 11.1, perhaps this issue would have been resolved for another version.

          Comment


          • #6
            Are you saying that you did not achieve convergence, or only that you received the warning that you might not? If you only received the warning, you probably don't need to worry about it. If you are having trouble achieving convergence, then click on the blue "cmp tips" link in the warning message.

            Comment


            • #7
              Thanks for bringing this option to my attention. Unfortunately, I took a second look and am still unsure whether convergence was reached.

              The output start with the following "Fitting individual models as starting point for full model fit.".
              It then continues to provide results for the 3 defined equations, each followed by the warning message regarding the regressor matrices.

              I then receive the following run time error:

              "Fitting constant-only model for LR test of overall model fit.
              *: 3200 conformability error
              cmp_lnL(): - function returned error
              <istmt>: - function returned error
              Mata run-time error
              Mata run-time error
              r(3200);"


              This leads me to believe the run did not converge.

              Per you suggestion, I clicked the "cmp tips" and I tried changing the technique, using the nonrtolerance and the difficult option as well as, but the error persists.
              Looking at the error codes I found that this code is returned when "​A matrix, vector, or scalar has the wrong number of rows and/or columns for what is required."
              Would this have something to do with the use of 4 IVs for 2 endogenous variables? Is there a way to check or re-specify the matrix dimensions?

              Thank you again,
              Yaara

              Comment


              • #8
                Oh, that's a crash, and the program should never crash, so that suggests a bug in cmp. If you can send me the data and code, I can look into it.

                Comment


                • #9
                  Hey David,

                  Would this cmp command work with ivreg2h setting? That is, the Lewbel estimator (Lewbel 2012) to appropriate the fact that I dont have an appropriate instrument and would like to exploit the heterskedasticity in the estimation?
                  I have somewhat similar estimation equation: a binary y with a binary endogenous x1. Nevertheless, I am not convinced with instruments I can fool around with and hence, I would like to implement ivreg2h setting.

                  I am stuck on this possibility and would like to know your views.

                  Many thanks and regards,
                  Sumit

                  Comment


                  • #10
                    Hi David,

                    Dose cmp command work for xtprobit and xtoprobit?

                    Thanks,
                    Maryam

                    Comment


                    • #11
                      Hello,
                      This thread has been useful as I am also estimating a probit model with a dummy endogenous variable.
                      I have a dummy outcome variable (y), an endogenous dummy variable (x1) and a continuous instrumental variable (z1) and my other control variables are a mix of discrete and continuous variables.
                      My command is:
                      Code:
                      cmp(y=x1 controls) (x1 = z1 controls), ind ($cmp_probit $cmp_probit)
                      But I get an error message also similar to #5 and #7.
                      Any advise on how I can progress or address this issue will be much appreciated.
                      Code:
                      Warning: regressor matrix for y equation appears ill-conditioned. (Condition number = 8412.6788.)
                      This might prevent convergence. If it does, and if you have not done so already, you may need to remove nearly
                      collinear regressors to achieve convergence. Or you may need to add a nrtolerance(#) or nonrtolerance option to the c
                      > ommand line.
                      Code:
                      Warning: regressor matrix for x1 equation appears ill-conditioned. (Condition number = 9024.7898.)
                      This might prevent convergence. If it does, and if you have not done so already, you may need to remove nearly
                      collinear regressors to achieve convergence. Or you may need to add a nrtolerance(#) or nonrtolerance option to the c
                      > ommand line.
                      See cmp tips.
                      
                      Fitting constant-only model for LR test of overall model fit.
                                     cmp_lnL():  3499  halton2() not found
                                       <istmt>:     -  function returned error
                      Mata run-time error
                      Mata run-time error

                      Comment


                      • #12
                        Any updates on why the "halton2() not found" error happens? I'm getting the same error. Is it a compatibility issue with stata 14?

                        Comment


                        • #13
                          Dear Statalists,

                          I want to estimate a simulteneous equations model with two dummy endogenous variables. My equations can be presented as follows :
                          y1 = y2 controls andy2= y1 controls

                          I know that in such a case, the command cmp is appropriate. But I would like to have the structure that can allow me to estimate such a model. Moreover, I would like to know if before the estimations, I have first to deal with the identification issue related to simulteneous equations modeling.

                          Comment

                          Working...
                          X