ความคิดเห็น •

  • @tonymony6112
    @tonymony6112 2 หลายเดือนก่อน +1

    Very helpful video for my Master Thesis

  • @eliasandersson6202
    @eliasandersson6202 5 หลายเดือนก่อน

    Very intuitive video! I have a panel with fixed entity and time effects. I would like to perform the durbin-watson statistic to check if I have autocorrelation, or how would I otherwise know if I need to have clustered covariance estimator? Thank you in advance!

    • @VincentCodesFinance
      @VincentCodesFinance 5 หลายเดือนก่อน

      I don't think linearmodels has the Durbin-Watson test built-in. Wooldridge (2011), section 10.6.3 suggests testing for autocorrelation in panels by taking the residuals of the pooled regressions, and regressing the residuals on their degree-1 lag (within entity), and checking if the coef is significant or not. This can easily be done as an extra step after the initial regression with linearmodels. The equation is something like this:
      e_i,t = rho e_i,t-1 + error_i,t
      You don't need a constant because e_i,t should be mean 0.
      Keep in mind that this tests for autocorrelation in the residuals, while you need to cluster when there is autocorrelation in the error terms of the model (so you should base your decision on theory as well)

  • @XXSinanovichXX
    @XXSinanovichXX 4 หลายเดือนก่อน

    Thank you for this video
    Is there a way to calculate newey west standard errors in 2SLS IV panel regressions using linearmodels?

    • @VincentCodesFinance
      @VincentCodesFinance 4 หลายเดือนก่อน

      It should work if you call .fit(cov_type="kernel") . By default it will use the bartlett kernel (same a Newey-West). You can specify the bandwidth using fit(cov_type="kernel", cov_config={"bandwidth": 3}) bashtage.github.io/linearmodels/devel/iv/iv/linearmodels.iv.model.IV2SLS.fit.html#linearmodels.iv.model.IV2SLS.fit