Announcement

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

  • GMM moment syntax

    The GMM command help file indicates that the syntax for a moment condition of the form: E(z'u)=0, where z consists of 3 variables for example, should be implemented by only specifying the u term as in:

    Code:
    gmm (y-exp({xb:educ exp exp2})), instruments(educ exp exp2)
    However, if I want an extra moment condition, such as E( [y-exp({xb:educ exp exp2}]*educ*educ]=0, then this cannot be immediately implemented using the interactive GMM command as the command assumes I want every variable in Z to be multiplied by every moment condition. If I try the command below:

    Code:
    gmm (y-exp({xb:educ exp exp2}))  ( (y-exp({xb:}))*educ)    , instruments(educ exp exp2)  twostep winitial(i)
    Then to me this generates 6 moment conditions when I only want 4 (the original 3 plus that extra one).

    How does one specify specific moment conditions using the GMM command?
    Last edited by Ash Williams; 20 Feb 2017, 15:00.

  • #2
    You are specifying 2 residual equations and for each of them you should specify a separate set of instruments by referring to the respective equation, i.e. instruments(1: educ exp exp2) instruments(2: educ)
    https://twitter.com/Kripfganz

    Comment


    • #3
      So thanks for the suggestion but I don't think that works. Consider the three commands below. All 3 should be the same but only the last two are. The first does not replicate OLS.


      Code:
      gmm ( (y-{xb:con educ })*con) ( (y-{xb:})*educ)    , instruments(1: con ,nocons) instruments(2: educ ,nocons)  
      
      
      gmm ( (y-{xb:con educ })) , instruments(con educ,nocons)
      
      reg y con educ,nocons

      Comment


      • #4
        That is not surprising because you are specifying two different residual equations in your first command. The following works with two separate moment conditions:
        Code:
        . sysuse auto
        
        . gmm (mpg - {b1}*gear_ratio - {b2}*turn) (mpg - {b1}*gear_ratio - {b2}*turn), instruments(1: gear_ratio, nocons) instruments(2: turn, nocons)
        
        . gmm (mpg - {xb: gear_ratio turn}), instruments(gear_ratio turn, nocons)
        
        . reg mpg gear_ratio turn, nocons
        https://twitter.com/Kripfganz

        Comment


        • #5
          Alright got it. I should not be editing the residual functions, just changing the instruments. I keep forgetting that one doesn't specify the x in E(x'u)=0 in the moment part of the command.

          Comment

          Working...
          X