Announcement

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

  • Endogenous Variable in Interaction, Simulatenous Equations, Use of IV

    Hi all,

    Background:

    I am dealing with the following demand equation :

    Sales = Price + Media + other exogenous variables

    Theoretically, Price and Media both are endogenous variables and are also dependent upon each other. In such a situation, I am trying to solve a simultaneous equations system:

    Sales = Price + Media + other exogenous variables

    Price = Media + lag_Sales + Z1 + other exogenous variables

    Media = Price + Media + lag_Sales + Z2 + other exogenous variables

    where Z1 & Z2 are instruments for price and media.

    I used reg3 command to solve the simultaneous equations and got results.

    Here is the Problem:

    Now the problem is advanced with the following demand equation:

    Sales = Price + Media + Price*Media+ Price*Media*cat1+ Price*Media*cat2 + i.cat* Price + other exogenous variables

    wherein there is an interaction between the endogenous variables, interaction of (price & media) with two indicator variables - cat1 & cat 2; finally, also there is an interaction af factor variables for cat1,cat2,cat3 interacted with the Price.

    Other two equations remain the same.

    Now, how do I deal with the endogeneity issue in these equations? How do I make sure that the interaction of endogenous variables is also corrected for endogeneity in a simultaneous equations system? Can I use reg3? If not, can someone advise a step by step procedure?

    Thank you!
    Guneet


  • Emad Shehata
    replied
    you are welcome

    Leave a comment:


  • Guneet Kaur
    replied
    Thank you Emad.

    Leave a comment:


  • Emad Shehata
    replied
    In fact Stata made an ingenous way to prevent interactions among endogenous variables to avoid misspecificaion problem.
    Best regards

    Leave a comment:


  • Emad Shehata
    replied
    In your model you have 2 endogenous variables
    Y2 and Y3
    If you make interactions
    Y4= y2*y3
    Then any software will deal with Y4 as a third endogenous variable

    Leave a comment:


  • Emad Shehata
    replied
    Interactions among endogenous variables have no economic meaning
    endogenous variables are treated as dependent variables in the first stage of 2SLS

    Leave a comment:


  • Guneet Kaur
    replied
    Dear Emad,

    Thank you so much for putting effort in writing the response.I really appreciate it. I have the following questions:
    1. I also want to allow for a term which is the interaction between two endogenous variables, i.e, the term y2*y3. So, how will the ivreg2 equation change? I want a coefficient in the result table for y2*y3.
    2. Also, since the interaction terms c.y2#c.x1 and c.y3#c.x1 are the included instruments, STATA will treat them as exogenous. However, that is not the case since the interaction terms c.y2#c.x1 and c.y3#c.x1 have y2 & y3 variables, which are endogenous.
    Thanks!
    Guneet

    Leave a comment:


  • Emad Shehata
    replied
    This example with 2 endogenous variables

    Code:
     clear all
    input float(y1 y2 y3 x1 x2) int(x3 x4) byte x5
     89.1  99.6  96.7  96.7   101  12  28  1
     99.2 102.6  98.1  98.1 100.1  15  35  2
       99 125.6   100   100   100  17  37  3
      100 130.1 104.9 104.9  90.6  22  42  4
    111.6 135.6 124.9 104.9  86.5  36  47  5
    122.2 142.2 109.5 109.5  89.7  45  51  6
    117.6 157.6 120.8 110.8  90.6  66  56  7
    121.1 125.2 112.3 112.3  82.8  89  60  8
      136   136 119.3 109.3  70.1  99  65  9
    154.2 154.2 115.3 105.3  65.4 118  69 10
    153.6 153.6 121.7 101.7  61.3 134  74 11
    158.5 155.5 125.4  95.4  62.5 151  78 12
    140.6 140.7 146.4  96.4  63.6 167  83 13
    136.2 176.2 127.6  97.6  52.6 184  87 14
      168 185.8 132.4 102.4  59.7 200  92 15
    154.3 186.3 132.6 101.6  59.5 217  96 16
      149   189 155.8 103.8  61.3 233 101 17
    end
    
     local X x1
     local Y y2 y3
     fvunab Z: c.x3##c.x4##c.x5
     fvunab XY: c.y2##c.x1 c.y3##c.x1
     local X: list XY - X
     local X: list X - Y
    
     ivreg2 y1 `X' (`Y' = `Z')

    HTML Code:
    .  ivreg2 y1 `X' (`Y' = `Z')
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics consistent for homoskedasticity only
    
                                                          Number of obs =       17
                                                          F(  5,    11) =     5.58
                                                          Prob > F      =   0.0084
    Total (centered) SS     =  9651.958509                Centered R2   =   0.7132
    Total (uncentered) SS   =  297003.9601                Uncentered R2 =   0.9907
    Residual SS             =  2768.137795                Root MSE      =    12.76
    
    ------------------------------------------------------------------------------
              y1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
              y2 |   3.547508   8.108174     0.44   0.662    -12.34422    19.43924
              y3 |   5.222722    12.7112     0.41   0.681    -19.69078    30.13622
              x1 |   9.459618   7.097883     1.33   0.183    -4.451976    23.37121
                 |
       c.y2#c.x1 |  -.0289516   .0806591    -0.36   0.720    -.1870406    .1291374
                 |
       c.y3#c.x1 |  -.0492394   .1266622    -0.39   0.697    -.2974927    .1990139
                 |
           _cons |  -945.6873   715.0449    -1.32   0.186     -2347.15    455.7749
    ------------------------------------------------------------------------------
    Underidentification test (Anderson canon. corr. LM statistic):           4.900
                                                       Chi-sq(6) P-val =    0.5568
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):                0.347
    Stock-Yogo weak ID test critical values:  5% maximal IV relative bias    16.88
                                             10% maximal IV relative bias     9.92
                                             20% maximal IV relative bias     6.16
                                             30% maximal IV relative bias     4.76
                                             10% maximal IV size             23.72
                                             15% maximal IV size             13.34
                                             20% maximal IV size              9.77
                                             25% maximal IV size              7.91
    Source: Stock-Yogo (2005).  Reproduced by permission.
    ------------------------------------------------------------------------------
    Sargan statistic (overidentification test of all instruments):          12.392
                                                       Chi-sq(5) P-val =    0.0298
    ------------------------------------------------------------------------------
    Instrumented:         y2 y3
    Included instruments: x1 c.y2#c.x1 c.y3#c.x1
    Excluded instruments: x3 x4 c.x3#c.x4 x5 c.x3#c.x5 c.x4#c.x5 c.x3#c.x4#c.x5
    ------------------------------------------------------------------------------

    Leave a comment:


  • Guneet Kaur
    replied
    Dear Carlo,

    xi option allows for only interactions with the factor variables, e.g. i.cat_id | price. But it does not allow for two continuous variables ,i.e. price | media.

    Thanks!

    Leave a comment:


  • Carlo Lazzaro
    replied
    Guneet:
    as far as your first question is concerned (
    ...'interactions not allowed'...
    ), check whether -ivreg2- support the -xi- prefix.

    Leave a comment:


  • Guneet Kaur
    replied
    Dear Emad,
    • I am getting error - 'interactions not allowed'.
    • Secondly, I am still not sure how ivreg2 command takes care of the simultaneous relation between Sales, Price & Media, lagged_Sales. Can you please explain?
    Thanks!
    Guneet

    Leave a comment:


  • Emad Shehata
    replied
    fvunab XY: c.y2##c.x1##c.x2 c.y3##c.x1##c.x2

    Leave a comment:


  • Emad Shehata
    replied
    The same idea
    local Y y2 y3
    And modify your local XY

    Leave a comment:


  • Guneet Kaur
    replied
    Thank you Emad.

    If I understand you answer correctly, are you just correcting for endogeneity of one of the endogenous variables (y2 it seems like- price) and not two (in my case - price & media)

    Also, since I am estimating the equations simultaneously (3 equations, not 1), I believe regular ivreg2 will not work. It can help us estimate just the key equation (equation 1 in my question above) and I still do know know the coefficients in equation 2 & 3.

    - Guneet

    Leave a comment:


  • Emad Shehata
    replied
    Code:
    di e(cmdline)
    
    ivreg2 y1 x1 c.y2#c.x1 x2 c.y2#c.x2 c.x1#c.x2 c.y2#c.x1#c.x2 (y2 = x3 x4 c.x3#c.x4 x5 c.x3#c.x5 c.x4#c.x5 c.x3#c.x4#c.x5)

    Leave a comment:

Working...
X