Announcement

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

  • IV with endogenous categorical variable

    Hello,
    I am trying to run an xtivreg with an endogenous categorical variable with the following code:
    Code:
    xi: xtivreg y x1 x2 ...x_n (i.qincome =z1 z2)
    equation not identified; must have at least as many instruments not in the regression as there are instrumented variables
    r(481);
    where:
    y: continuous dep. var.
    x1...x_n: exogenous variables
    z1 z2: continuous instruments
    i.qincome: endogenous categorical variable (income quartile)

    When I try without the xi prefix, it gives a new error.
    Code:
    xtivreg y x1 x2 ...x_n (i.qincome =z1 z2)
    depvars may not be factor variables
    r(198);
    Is there a way to solve this please?

  • #2
    look at eregress and xteregress. some of those variants allow oprobit.

    Code:
    sysuse auto, clear
    tab rep78  //use as ordered
    eregress price weight , endogenous(rep78 = foreign mpg, oprobit)

    Comment


    • #3
      I tried it but the number of iteration exceeded 122 for about an hour and still not converging it keeps switching technique from bhhh to nr in a loop.
      any alternatives?

      Comment


      • #4
        gsem

        Comment


        • #5
          Hi Fatima. There are two issues. The first is the mechanical one of how how to get three (of the four) quantile income variables in the model. I would generate separate dummies. Something like this:

          Code:
          gen q2 = qincome == 2
          gen q3 = qincome == 3
          gen q4 = qincome == 4
          The bigger problem is how to obtain instruments because you have three endogenous variables and only two IVs. But it can be done, using a modification of what George suggested. Assuming you have defined qincome accordingly -- which means knowing the actual income quartiles, so you can use them in the -intreg- command -- with known cut points. Then obtain the fitted probabilities of each outcome to use as an IV. It's something like this, although I'm not sure the details are exactly correct. It depends exactly how qincome is defined. You have to define lower and uppre based on the income quantiles.

          Code:
          intreg lower upper x1 ... xK z1 z2
          predict p1hat, pr(.,quant1)
          predict p2hat, pr(.,quant2)
          predict p3hat, pr(.,quant3)
          predict p4hat, pr(.,quant4)
          
          ivregress 2sls y x1 ... xK (q2 q3 q4 = p2hat p3hat p4hat), vce(robust)

          Comment


          • #6
            Hi All,

            I am having a related but slightly different issue. I am trying to run ivreg2 where the endogenous variable (i.e., age category) has four categories (youngest, younger, age-appropriate, and older) and only one instrument, i.e., theoretical age. The categories are derived using a rule that one can enter a school at the age of 6 years. Now, I followed what Jeff Wooldridge suggested earlier in this thread. I started by creating three dummies for each category. However, instead of -intreg- I have used -reg- to find out fitted probabilities. I also tried using -probit- with individual dummies but somehow it was predicting perfectly.


            code:
            Code:
            reg CategOFage iv_modi gender ASBGHRL ASBGSLM ASDHAPSdummy2 ASDHAPSdummy3 ASDHAPSdummy4 
            
            predict age1hat, pr (.,AGECat1 )
            predict age2hat, pr (.,AGECat2 )
            predict age3hat, pr (.,AGECat3 )
            predict age4hat, pr (.,AGECat4 )
            
            ivreg2 testscore (AGECat1 AGECat2 AGECat4= iv_modi age1hat age2hat age4hat) New_gender ASBGHRL ASBGSLM ASDHAPSdummy2 ASDHAPSdummy3 ASDHAPSdummy4 , first
            CategOFage is my endogenous variable
            iv_modi is my instrument
            AGECat1-4 are the age categories

            Is it right to do like this? Also, I am getting very high F-stat for my first stage, 1500 for Category1 and near about 4500 for other two categories. Is it normal or something is wrong?

            Another related doubt is, can we use interaction of IV with any other control variable as an IV ? Is it valid?

            Thanks

            Comment

            Working...
            X