Announcement

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

  • Sebastian Kripfganz
    replied
    I think there are at least two things that are potentially confusing here.

    First, in my quoted post, lag 0 of L.n refers to L.n itself, which is lag 1 of n.

    Second, the FOD transformation and the first-difference transformation are not the same. (Xi,t-1 - Xi,t-2) is the first-difference transformation of Xi,t-1. The FOD transformation would subtract the average of Xi,t-1 Xit Xi,t+1 ... Xi,T from Xi,t-1. This average does not contain Xi,t-2.

    In your two-equations example. Xit is predetermined because it is a function of Yit-1. But Xit-1 is uncorrelated with the error term in εit (and any future error term) in equation 1, which is all that is needed for it to be a valid instrument (in the FOD-transformed model).

    Leave a comment:


  • Nursena Sagir
    replied
    Dear Sebastian,

    I have a question regarding to your quote below:

    Originally posted by Sebastian Kripfganz View Post

    Please have a look at my 2019 London Stata Conference presentation. Slide 67 tells you the admissible lags under forward-orthogonal deviations. For strictly exogenous regressors (which I implicitly assumed here for w and k), any lag can be used. For predetermined regressors (L.n), lag 0 is the first admissible lag. In my specification, I assumed indeed that there are no endogenous variables (with respect to the idiosyncratic error term) in the model.

    For the level model, slide 31 tells you the additionally available instruments. For strictly exogenous and predetermined regressors, lag 0 of the first-differenced instruments is usually used (because it has the strongest correlation with the instrumented variables compared to any other lag). It is common practice not to use multiple lags as instruments for the level model (based on the idea that further lags would be redundant if all available lags were used for the transformed model).
    I did not understand how lag 0 is the first admissible lag if L.n is a regressor in the estimation equation. I will give you a example.

    Assume that you would like to run a model with reverse causality:
    1. Yit = Yit-1 + Yit-2 + Xit-1 + Xit-2 + εit
    2. Xit = Xit-1 + Xit-2 + Yit-1 + Yit-2 + εit
    But, when differenced in FOD estimation, Xi,t-1 appears directly in (Xi,t-1 - Xi,t-2) in equation 1. I do not understand how can I use Xi,t-1 as an instrument - not because of correlation with the error terms, but because it's a regressor in the differenced equation. But when I define Xit-1 as predetermined regressor it means lag 0 (Xit-1) is the first admissible lag. Or if I define it as endogenous, then lag 1 (Xit-2) can be used but it is also included as regressor. It this something that I should be concerned? Should I start from lag 3 and use gmm(Xi,t-1, lag(3 .))?

    Or should I just think that the sequential exogeneity condition (allowing εit to correlate with future x values) accounts for reverse causality regardless of how I specify the lag structure in the model. So, I can use regressors as theory points and classify the instruments based on coherence tests?

    Thank you for your reply.

    Best regards,
    Nursena

    Leave a comment:


  • Tullio Gregori
    replied
    Thank you Sebastian
    you are right and maybe in this setting we should go for the Sargan's difference test as suggested by Sarafidis, Yamagata and Robertson


    https://www.sciencedirect.com/scienc...608001826#sec3

    thanks again

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The CD test is not designed for use after GMM estimation. I do not have enough experience with this test to provide a more solid judgement.

    Leave a comment:


  • Tullio Gregori
    replied
    Dear Sebastian
    in your post 367
    https://www.statalist.org/forums/for...40#post1652040
    you suggest an incremental Hansen test for the validity of the moment conditions for the lagged dependent variable to check for cross-sectional dependence
    I wonder if a standard cd test on residuals may suffice.
    Thanks for your reply

    Leave a comment:


  • Sarah Magd
    replied
    Thank you very much Prof. Sebastian Kripfganz

    What we do in the first step, before using GMM, is estimate our models with FE and show different specifications. We also report the R² and adjusted R². As I understand from your answer, I can rely on the R² values to compare my specifications, since R² is not affected by the endogeneity problem caused by the simultaneity issue. Is that correct?

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I am not sure why you would even care about this R2. It gives you the fraction of the variance of the dependent variable that is explained by the variance of the linear prediction from the explanatory variables. This linear projection does not have a causal interpretation; thus, the notion of endogeneity is not meaningful in this context.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Sebastian Kripfganz

    In the regression where I have the simultaneity issue (i.e., before addressing the endogeneity), can we rely on the value of the resulting R2 from this regression? or would the simultaenity issue and the associated endogeneity can distort the value of the R2?

    Could you please guide me on this?

    Leave a comment:


  • Sebastian Kripfganz
    replied
    These GMM estimators are intended for panels data sets with a relatively small number of time periods (T) and a relatively large number of cross sections (N). For such panel data, stationarity tests are usually not of much interest.

    Leave a comment:


  • streley paul
    replied
    Faut-il effectuer des tests de stationnarité avant d’effectuer la modélisation GMM ?

    Leave a comment:


  • Arkangel Cordero
    replied
    Dear Professor @Sebastian Kripfganz

    Thank you for clarifying!

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The Windmeijer correction is a finite-sample variance correction. Asymptotically, standard errors and any tests based on them are still valid without the correction.

    No, the "difference GMM" estimator does not se lagged differences as instruments for the model in level. If you look again at your iv2 instrument in post #654, you will see that the lagged level (which is the value for year 1979) is repeated with a negative sign in the previous year. This is not a difference by itself, but it mechanically ensures that the sum over time multiplied by a constant (such as the fixed effect) equates to zero. In other words, the instrument is orthogonal to any time-invariant variable. This does not require any additional assumption about uncorrelatedness.

    Leave a comment:


  • Arkangel Cordero
    replied
    Dear Professor @Sebastian Kripfganz
    Wow! Thank you so much for your help. Really helpful. I have two follow up questions:

    1) Does the fact that ivreg2 cannot do the Windmeijer correction invalidate the diagnostics (under, weak and over identification tests) generated by this command after "xtdpdgmm, predict iv" ? From your 2019 London Stata Conference presentation, I infer this is not the case, but I just want to double check. Why is this not the case?

    2) In your last response above, it seems that when estimating the difference gmm, xtdpdgmm estimates the model in levels and uses lagged differences as instruments. Is that correct? If so, I recall a previous discussion about this making the assumption that the fixed-effects are uncorrelated with the differences (changes in the levels). Is this only problematic in the "system" gmm? Why is it not a problem in the difference gmm? I apologize in advance if I am confusing things.

    Thank you again.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    We might be using different versions of ivreg2.
    Code:
    . which ivreg2
    *! ivreg2 4.1.12  14aug2024
    With your code, I actually cannot replicate the first xtdpdgmm results. This only works if I add the option nocollin to the ivreg2 command line:
    Code:
    xtdpdgmm L(0/1).n (yr1978-yr1984) w k, model(diff) twostep nolevel nocons gmm(L.n, l(1 1)) iv(yr1978-yr1984 w k) vce(cluster id)
    estimate store m1_xtdpdgmm
    capture drop iv*
    quietly predict iv*, iv
    
    ivreg2 n (L.n w k yr1978-yr1984 = iv*), gmm2s cluster(id) nocons nocollin
    I am still not sure what you mean by "defaults". To replicate the results with a different weighting matrix, you can supply this weighting matrix with the ivreg2 option wmatrix():
    Code:
    xtdpdgmm L(0/1).n (yr1978-yr1984) w k, model(diff) twostep nolevel nocons gmm(L.n, l(1 1)) iv(yr1978- yr1984 w k) vce(cluster id) wmatrix(separate)
    estimate store m2_xtdpdgmm
    capture drop iv*
    quietly predict iv*, iv
    local iv "`r(iv)'"
    matrix W = e(W)
    matrix roweq W = ""
    matrix coleq W = ""
    matrix rownames W = `iv'
    matrix colnames W = `iv'
    ivreg2 n (L.n w k yr1978-yr1984 = iv*), cluster(id) nocons nocollin wmatrix(W)
    Note that in this example, the matrix W actually contains the optimal weighting matrix for the second step, which is why I have dropped the gmm2s option from ivreg2. Alternatively, you can obtain the initial weighting matrix from the one-step estimator:
    Code:
    xtdpdgmm L(0/1).n (yr1978-yr1984) w k, model(diff) twostep nolevel nocons gmm(L.n, l(1 1)) iv(yr1978- yr1984 w k) vce(cluster id) wmatrix(separate)
    estimate store m2_xtdpdgmm
    capture drop iv*
    quietly predict iv*, iv
    local iv "`r(iv)'"
    quietly xtdpdgmm L(0/1).n (yr1978-yr1984) w k, model(diff) nolevel nocons gmm(L.n, l(1 1)) iv(yr1978- yr1984 w k) vce(cluster id) wmatrix(separate) onestep
    matrix W = e(W)
    matrix roweq W = ""
    matrix coleq W = ""
    matrix rownames W = `iv'
    matrix colnames W = `iv'
    ivreg2 n (L.n w k yr1978-yr1984 = iv*), gmm2s cluster(id) nocons nocollin wmatrix(W)
    ivreg2 does not have an option for the Windmeijer correction.

    The instruments creates by predict with option iv are transformed such that they always refer to the level model. Notice that in your replication of the first model, you did not specify the variables in first differences when using ivreg2. In contrast, when you created the instruments by hand, you then called ivreg2 with first-differenced variables. Please see slide 33 of my 2019 London Stata Conference presentation.

    Leave a comment:


  • Arkangel Cordero
    replied
    Dear Professor @Sebastian Kripfganz

    Thank you for your help! I was not clear in my third question. What I meant to ask is whether it is possible to replicate the point estimates for xtdpdgmm with its default options using ivreg2 when the gmm-style instruments for ivreg2 are generatred by hand. For example:

    Code:
    
    webuse abdata, clear
    
    /* xtdpdgmm with its defaults */
    xtdpdgmm L(0/1).n  (yr1978- yr1984) w k,  model(diff) twostep nolevel nocons  gmm(L.n , l(1 1))  iv(yr1978- yr1984 w k)  vce(cluster id)
    estimate store m1_xtdpdgmm
    capture drop iv*
    quietly predict iv*, iv
    
    ivreg2 n (L.n w k yr1978- yr1984 = iv*), gmm2s cluster(id) nocons
    estimate store m1_ivreg2
    
    
    
    /* xtdpdgmm with "wmatrix(separate)" */
    xtdpdgmm L(0/1).n  (yr1978- yr1984) w k,   model(diff) twostep nolevel nocons  gmm(L.n , l(1 1))  iv(yr1978- yr1984 w k)  vce(cluster id) wmatrix(separate)
    estimate store m2_xtdpdgmm
    
    * Create "gmm-style" instruments by hand    
    foreach var of varlist n {
        di "`var'"
        forvalues lag = 2(1)2 {
            display `lag'
             capture drop il`lag'`var'
             gen il`lag'`var' = L`lag'.`var'
             replace il`lag'`var' = 0 if il`lag'`var' ==.
     
    
            foreach year of varlist yr1978- yr1984 {
                capture drop i`year'l`lag'`var'
                gen i`year'l`lag'`var' = `year' * il`lag'`var'
                replace i`year'l`lag'`var' = 0 if i`year'l`lag'`var'  == .
                
    }
        drop il`lag'`var'
    }
    }
    
    sum iyr*
    
    
    ivreg2  D.n yr1978 - yr1984 (D.L.n D.w D.k  = iyr* w k), gmm2s nocons cluster(id)
    estimate store m2_ivreg2
    
    
    esttab  m1_xtdpdgmm m1_ivreg2 m2_xtdpdgmm m2_ivreg2, order(L.n LD.n w D.w  k D.k) b(7) se(8)
    
    
    -----------------------------------------------------------------------------
                          (1)             (2)             (3)             (4)  
                            n               n               n             D.n  
    ----------------------------------------------------------------------------
    L.n             0.5506190       0.5506191**     0.4111800                  
                 (0.30921166)    (0.20419585)    (0.26059471)                  
    
    LD.n                                                            0.4111800*  
                                                                 (0.18245773)  
    
    w              -1.0048009**    -1.0048008***   -1.0111454**                
                 (0.30828038)    (0.24825200)    (0.33363667)                  
    
    D.w                                                            -1.0111454***
                                                                 (0.26820416)  
    
    k               0.2998862       0.2998862       0.3981729                  
                 (0.21708074)    (0.15620364)    (0.22582202)                  
    
    D.k                                                             0.3981729*  
                                                                 (0.16615589)  
    
    yr1978         -0.0309086*     -0.0309086*     -0.0351301*     -0.0351301**
                 (0.01374235)    (0.01249613)    (0.01521336)    (0.01288389)  
    
    yr1979         -0.0388346*     -0.0388346*     -0.0433236*     -0.0081935  
                 (0.01775684)    (0.01648030)    (0.02045487)    (0.00863804)  
    
    yr1980         -0.0585632***   -0.0585632***   -0.0630416***   -0.0197180  
                 (0.01731379)    (0.01627237)    (0.01833015)    (0.01054987)  
    
    yr1981         -0.0950787***   -0.0950787***   -0.0925442***   -0.0295026  
                 (0.02820044)    (0.02412458)    (0.02471889)    (0.01662232)  
    
    yr1982         -0.0621763*     -0.0621763*     -0.0631975*      0.0293467*  
                 (0.02868215)    (0.02467994)    (0.02990375)    (0.01438922)  
    
    yr1983         -0.0079399      -0.0079399      -0.0160096       0.0471880**
                 (0.02561728)    (0.02466424)    (0.03242727)    (0.01520720)  
    
    yr1984          0.0218494       0.0218494       0.0080898       0.0240994  
                 (0.03371198)    (0.03195472)    (0.04064090)    (0.01903547)  
    ----------------------------------------------------------------------------
    N                     891             891             891             751  
    ----------------------------------------------------------------------------
    Standard errors in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

    So, the first ivreg2 (m1_ivreg2) replicates xtdpdgmm with its defaults, while the second ivreg2 (m2_ivreg2) replicates xtdpdgmm with "wmatrix(separate)". My questions are:

    1) Are there any options that can be added to the second "ivreg2" command (m2_ivreg2)--which has the gmm-style instruments generated by hand--so that it replicates the point estimates for "xtdpdgmm" with its defaults (m1_xtdpdgmm)?

    2) Does "ivreg2" have any options that would allow it to make the Windmeijer correction in SE?

    3) I noticed that the instruments generated by "predict, iv" after "xtdpdgmm" are similar, but not exactly the same as those generated by hand (please see below). The column "iv2" corresponds to an instrument created by "predict, iv" after "xtdpdgmm" whereas "iyr1979l2n" is the equivalent instrument created by the loop above. How can one make sense of a negative version of the lag in the preceding year in the "iv2" column?

    Code:
    clear
    input float(id year iv2 iyr1979l2n)
     1 1977          .          0
     1 1978 -1.6176045          0
     1 1979  1.6176045  1.6176045
     1 1980          0          0
     1 1981          0          0
     1 1982          0          0
     1 1983          0          0
     2 1977          .          0
     2 1978  -4.267163          0
     2 1979   4.267163   4.267163
     2 1980          0          0
     2 1981          0          0
     2 1982          0          0
     2 1983          0          0
     3 1977          .          0
     3 1978  -2.952616          0
     3 1979   2.952616   2.952616
     3 1980          0          0
     3 1981          0          0
     3 1982          0          0
     3 1983          0          0
     4 1977          .          0
     4 1978 -3.2642314          0
     4 1979  3.2642314  3.2642314
     4 1980          0          0
     4 1981          0          0
     4 1982          0          0
     4 1983          0          0
    Thank you for your always kind help!
    Last edited by Arkangel Cordero; 31 Oct 2024, 16:25.

    Leave a comment:

Working...
X