Generalized Method of Moments (GMM) for Panel Data In R (System GMM, Difference GMM, Dummy variable)

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • I offer personalized consulting services, where you can provide me with your data and detailed explanations, and I'll handle the analysis for you.
    ouassouhoussin@gmail.com
    To download the code and the dataset used in the video check the repository:
    github.com/kol...
    Don't just take my word for it. Explore the testimonials of my satisfied clients on the Freelancer platform: www.freelancer...
    By becoming a patron, you'll gain exclusive access to the complete R code, datasets, detailed PDF guides, and timely updates (including the latest release on May 11, 2024).
    / shop
    I offer personalized consulting services, where you can provide me with your data and detailed explanations, and I'll handle the analysis for you. Alternatively, if you have a published study you wish to replicate, I'll navigate the process seamlessly.

КОМЕНТАРІ • 44

  • @Nauryzka
    @Nauryzka 3 роки тому +3

    Thank you very much. After a long search, you are the first who explains normally. I didn't even understand my own language. Your explanations are clear, simple, and straightforward.

  • @ГерманУханев
    @ГерманУханев 2 роки тому

    Hi, i just left my vpn where i wasn`t logged in to my youtube to say you thank you. Everything is clear. Wish you all the very best :)!

  • @Alexandru-3
    @Alexandru-3 3 роки тому +4

    Life saver. Thank you and I wish you all the very best!

  • @aliennaciri1470
    @aliennaciri1470 3 роки тому +4

    Thank you brother , I wish you more success

  • @TheMarinho1
    @TheMarinho1 2 місяці тому

    Great video. Quick question: Roodman (2009) suggest to repor the instrumtent varibale count. How can I display that in pgmm?

  • @dianachaukatchaib2443
    @dianachaukatchaib2443 3 роки тому +1

    Thank you for the video! Excellent and help so much

  • @florianmoussi5238
    @florianmoussi5238 Рік тому +1

    Thanks for your presentation, I didn't understand or I misheard but what does effect = "individual" mean? Unfortunately I couldn't find anything about this.

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  Рік тому

      try to read the plm package document it contains all details about this specification. "the effects introduced in the model, one of "twoways" (the default) or "individual""

  • @sacumut
    @sacumut 3 роки тому +1

    very useful. Thank you!

  • @swastikamukharjee9662
    @swastikamukharjee9662 7 місяців тому

    Each time I'm running as effects= "twoways", I'm getting an error message as 'Error in solve.default(crossprod(WX, t.CP.WX.A1)) :
    system is computationally singular: reciprocal condition number = 1.12264e-21'... Can you please shed some light?

  • @rossanaarcano1313
    @rossanaarcano1313 2 роки тому +1

    Hi, thank you for your video. I have a question: how to understand when a variable needs to be considered in lag and when in diff - I mean when: lag(x, 1:1) or when: diff(x, 1:1).
    Thank you!

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  2 роки тому +2

      @Rossana Arcano - For instance, if you are trying to replicate a study done by another researcher and you are using the same inputs (model specification, variables, time span...), and the researcher mentioned that his study has significant results when he chose the first lag for all independent variables, then you need to use the same parameters to see if his hypothesis (inputs) hold also in your study. additionally, this may help you in the Discussion section when trying to contextualize your results among the previous literature. otherwise, you can use different inputs (lag, difference, ...), it depends on your case.
      Some clarification:
      lag(x,2:2) means that you are using only the second lag of the x variable (only one variable )
      lag(x, 2:10) means that you are using a list of variables that goes from the second lag of x to the 10th lag of x (10-2 variables).
      The same for the difference diff().

  • @ricardoolivabravo9590
    @ricardoolivabravo9590 2 роки тому

    Hello, in my case it appears like this when I try to use pgmm:
    "Error in cbind(yX1[[i]], V1) :
    number of rows of arrays must match (see arg 2)"
    Do you know why this happens?
    Thanks in advance.

  • @joylm9108
    @joylm9108 Рік тому +1

    Hello prof. I sent you an email. I want to know if I can accept my model if AR(1) is not significant and AR(2) is also not significant. I tried different lags to improve my model, but none worked.

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  Рік тому +1

      @Joy LM I answer your questions with suggestions for improvement, check your Gmail.

  • @rossanaarcano1313
    @rossanaarcano1313 Рік тому

    Hi. How can I add the intercept (constant) to the output of the Arellano-Bond/Blundell-Bond? Thank you.

  • @chinhducvu
    @chinhducvu 2 роки тому +1

    Hi sir, how to get the numbers of instruments used in GMM. I have searched so many websites but can't find the answer. Thank you

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  2 роки тому +1

      It's already in the output. you have the Number of observations used 204 and the panel data T=12, and N=12 (12*12=144)==> 204-144 is the number of instruments used

    • @chinhducvu
      @chinhducvu 2 роки тому

      @@EconometrIQ_Insider thank you for your answer. The problem is that when I added collapse = true in the syntax, the number of observations are the same without collapsed instruments. If uses your calculation, the instruments used in both models are miscalculated

    • @rossanaarcano1313
      @rossanaarcano1313 Рік тому

      @@chinhducvu did you find the answer to this problem? I have the same problem too

  • @wirdatuljannah3923
    @wirdatuljannah3923 4 роки тому

    Thank you. But i still confuse when u said model for test01. Diff(index, 1:1) is index(i, t-1) not distance between index t-1 and index t. If u said before, so that the lag and diff is the same??

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  4 роки тому +1

      The LAG function remembers the value you pass to it and returns as its result the value you passed to it on the previous call. The DIF function works the same way but returns the difference between the current argument and the remembered value. (LAG and DIF return a missing value the first time the function is called.)
      So the LAG and DIF are not the same:
      LAG: Returns the previous nth value of a variable.
      DIF: Returns the difference between the current value of a variable and the previous nth value (i.e. nth lag).

  • @charithkrish
    @charithkrish 3 роки тому

    Hi, this is great, can you interpret the results and evaluate the validity of entire model (e.g. F-test)?

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  3 роки тому +1

      Yes, absolutely Charith Krish
      Sargan and Hansen are used to test the overall validity of the instruments.
      The null hypothesis is: Instruments as a group are exogenous.
      If the p value of sargan test is1; it means there are so many instruments in the model. Collapse option is required according to Roodman(2009)
      I advise you to see this papper:
      Roodman, D. (2009). How to do xtabond2: An introduction to difference and system GMM in Stata. The stata journal, 9(1), 86-136.
      follow his methodology.it will help a lot

    • @charithkrish
      @charithkrish 3 роки тому +1

      @@EconometrIQ_Insider Hi thanks a lot. Appreciate your support.

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  3 роки тому

      @@charithkrish you're welcome

    • @rossanaarcano1313
      @rossanaarcano1313 Рік тому

      @@EconometrIQ_Insider hi. What is the threshold for an optimal Sargan p-value?

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  Рік тому

      @@rossanaarcano1313 Please see the following Discussion: www.researchgate.net/post/How-to-interpret-Sargan-test-for-difference-GMM-estimator#:~:text=Sargan%20p%2Dvalue%20must%20not,should%20be%20greater%20than%200.25.
      "Sargan p-value must not be less < 5% and > 10%. The higher the p-value of the sargan statistic the better. However according to Roodman (2006) , it is recommended that sargan p-value should be greater than 0.25" Another way is the see the paper that you are using as reference and try to have the same outcomes.

  • @joylm9108
    @joylm9108 2 роки тому

    why do you define your dynamic panel model to include "diff" instead just "lags"?

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  Рік тому

      @Joy LM it depends on your Literature review, if you find the previous research use lag then you need to verify this Hypothesis by following the same inputs (number of lag, which variables are lagged, and by which level...) done by the paper. if that is not verified then it's okay to use your own (inputs), you can include those steps in the "Methodological" section.

    • @joylm9108
      @joylm9108 Рік тому +1

      @@EconometrIQ_Insider Thanks so much for your reply. I followed your exact example for sys gmm but I keep getting this error "Error in !class_ind : invalid argument type" when I want to display the summary result. Do you have any idea why?

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  Рік тому +1

      @@joylm9108 I think something has to do with your data, I need to see your data and your code to have an exact idea. feel free to contact me in Gmail. follow the above link to my GitHub profile you will find my gmail.

    • @joylm9108
      @joylm9108 Рік тому

      @@EconometrIQ_Insider Thank you.

  • @luisajohannsen8797
    @luisajohannsen8797 Рік тому

    Hi, just letting you know I sent you an email with a question regarding this video. Thanks in advance!

  • @teofilanguema1645
    @teofilanguema1645 2 роки тому +1

    Omg I’m trying to learn this method but I have not clue 😩😓

    • @EconometrIQ_Insider
      @EconometrIQ_Insider  2 роки тому

      you need to read handbooks that explain the method using mathematical demonstrations

  • @akeemrahaman4211
    @akeemrahaman4211 3 роки тому +1

    Dear El Houssin, I sent you an email for your consideration.