Announcement

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

  • ARDL panel model in STATA

    Hi mates, I have a question about ARDL model in Stata
    As I know The XTPMG command can calculate the ARDL (1 1). here is my command :
    xtpmg d.lreerq d.lgdppcq d.nfagdpq d.ltotq d.lopenq d.lgovgdpq d.flo, lr(lreerq lgdppcq nfagdpq ltotq lopenq lgovgdp flo) ec(ECT) replace omg
    After running this command I am not getting significant coefficients , so i want to run the ARDL(121111)
    I generated a new variable which is the lagged (1) of the lgdppcq and named it lgdppcq_lag using the following command :
    gen lgdppcq_lag = lgdppcq[_n-1]
    Then I substituted the lgdppcq by lgdppcq_lag in the xtpmg command , as following :
    xtpmg d.lreerq d.lgdppcq_lag d.nfagdpq d.ltotq d.lopenq d.lgovgdpq d.flo, lr(lreerq lgdppcq_lag nfagdpq ltotq lopenq lgovgdp flo) ec(ECT) replace omg
    MY QUESTION is :
    Am I running an ARDL(121111) model by this command ?
    waiting your answer, and thank you very much in advance ...


    Regards

  • #2

    I don't know what an ARDL(xxxx) model implies exactly, but I'd like to point out that gen x = x [_n-1] is not a good way to generate lagged variables. Rather, I suggest you use L.x in the regression command and let Stata do its thing, or generate it yourself as L_x = L.x. The problem with the _n-1 method is that for the second panel, this will use the last value of the first panel as its first observation. Same for the 3rd and so on. Additionally, if your data are not equally spaced (i.e. you have gaps), this will also produce wrong results.

    A second note, the xtpmg command does not calculate a "standard" panel ARDL model. Rather, its default (pmg) will calculate separate ardl models for each panel unit (e.g. N regressions), but constrain the long run coefficients of the variables in lr() to be the same across all panels. If you want to calculate the more standard pooled ARDL model, simply use reg.

    Comment


    • #3
      Please try:
      Code:
      xtpmg d.lreerq d(1/2).lgdppcq d.nfagdpq d.ltotq d.lopenq d.lgovgdpq d.flo, lr(l.lreerq lgdppcq nfagdpq ltotq lopenq lgovgdp flo) ec(ECT)
      Ho-Chuan (River) Huang
      Stata 17.0, MP(4)

      Comment


      • #4
        Dear Mr.River Huang and Mr.Jesse Wursten and all, here i am showing you the results I got from couple of regressions I have done, please check the word file and tell me how to interpret the results and with model or which regression i should run, thanks very much
        waiting your Feedback ASAP
        Attached Files

        Comment


        • #5
          Abbes:
          your request is not consistent with the way this forum works.
          As far as I can see, these are your first posts on this forum and you might have not read the FAQ yet.
          However, I take the liberty to express some considerations, that you can take in due count or not, as you like, being an unrequested advice.
          As everybody is free to reply or not to to any query, it is not in the spirit of this forum to urge people to check what you did and report to you ASAP.
          Otherwise, as per FAQ, you should conctact the contributors you prefer off the list (i.e., via a private message) and make an arrangement with them for a consultancy.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Originally posted by River Huang View Post
            Please try:
            Code:
            xtpmg d.lreerq d(1/2).lgdppcq d.nfagdpq d.ltotq d.lopenq d.lgovgdpq d.flo, lr(l.lreerq lgdppcq nfagdpq ltotq lopenq lgovgdp flo) ec(ECT)
            Thank you for your Help, Appreciated

            Comment


            • #7
              Originally posted by Jesse Wursten View Post
              I don't know what an ARDL(xxxx) model implies exactly, but I'd like to point out that gen x = x [_n-1] is not a good way to generate lagged variables. Rather, I suggest you use L.x in the regression command and let Stata do its thing, or generate it yourself as L_x = L.x. The problem with the _n-1 method is that for the second panel, this will use the last value of the first panel as its first observation. Same for the 3rd and so on. Additionally, if your data are not equally spaced (i.e. you have gaps), this will also produce wrong results.

              A second note, the xtpmg command does not calculate a "standard" panel ARDL model. Rather, its default (pmg) will calculate separate ardl models for each panel unit (e.g. N regressions), but constrain the long run coefficients of the variables in lr() to be the same across all panels. If you want to calculate the more standard pooled ARDL model, simply use reg.
              Thanks Jesse for your reply and I shared with you the results I hv got , thank you so much

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Abbes:
                your request is not consistent with the way this forum works.
                As far as I can see, these are your first posts on this forum and you might have not read the FAQ yet.
                However, I take the liberty to express some considerations, that you can take in due count or not, as you like, being an unrequested advice.
                As everybody is free to reply or not to to any query, it is not in the spirit of this forum to urge people to check what you did and report to you ASAP.
                Otherwise, as per FAQ, you should conctact the contributors you prefer off the list (i.e., via a private message) and make an arrangement with them for a consultancy.
                Thank you , have nice day

                Comment


                • #9
                  To the best of my knowledge ARDL can not be run on panel data in STATA. XTPMG or PMG wouldnt help there. Am I right ?

                  Comment


                  • #10
                    Please

                    For an ARDL Panel with lags determined using Criterion (SIC) how to estimate?

                    Considering: xtpmg aa dollar, lr (aa dollar) and ec (ect) replace pmg.

                    thank you!

                    Comment


                    • #11
                      Originally posted by Rafael Noriller View Post
                      Please

                      For an ARDL Panel with lags determined using Criterion (SIC) how to estimate?

                      Considering: xtpmg aa dollar, lr (aa dollar) and ec (ect) replace pmg.

                      thank you!
                      Hi Rafael, how many countries are in your data? and in case you have not gotten any response, you can modify this code (given by a Statalister on this forum):

                      forval i = 1/10{
                      ardl aa dollar if (country_code==`i'), maxlag(3 3)
                      matrix list e(lags)
                      di
                      }

                      Eventually you will receive for each country a summary line like this (this is just an illustration, I cannot predict what will be the lag numbers in your case)

                      e(lags)[1,3]
                      aa dollar
                      r1 3 1

                      Then, you choose for each of both variables, the maximal lag length over all countries (suppose 10 as the number of countries). Lets assume that you will receive the following lag lengths:
                      aa = 2; dollar = 3

                      Then you specify the xtpmg command as:
                      xtpmg d(1).aa d(1/3).dollar, lr(l.credit rate gdp) ec(ECT) replace pmg

                      Hope it helps.

                      Comment


                      • #12
                        Originally posted by Ngozi ADELEYE View Post

                        Hi Rafael, how many countries are in your data? and in case you have not gotten any response, you can modify this code (given by a Statalister on this forum):

                        forval i = 1/10{
                        ardl aa dollar if (country_code==`i'), maxlag(3 3)
                        matrix list e(lags)
                        di
                        }

                        Eventually you will receive for each country a summary line like this (this is just an illustration, I cannot predict what will be the lag numbers in your case)

                        e(lags)[1,3]
                        aa dollar
                        r1 3 1

                        Then, you choose for each of both variables, the maximal lag length over all countries (suppose 10 as the number of countries). Lets assume that you will receive the following lag lengths:
                        aa = 2; dollar = 3

                        Then you specify the xtpmg command as:
                        xtpmg d(1).aa d(1/3).dollar, lr(l.credit rate gdp) ec(ECT) replace pmg

                        Hope it helps.
                        Hi Ngozi Adeleye and Rafael,

                        I am using panel ARDL, and I am stuck with number of lag selection.

                        I am using the code what Ngozi mentioned, but I still do not follow your explanation.

                        Once I loop 10 countries, I have following results:

                        Country1: e(lags)[1,3]
                        aa dollar
                        r1 3 1

                        Country2: e(lags)[1,3]
                        aa dollar
                        r1 2 0

                        Country3: e(lags)[1,3]
                        aa dollar
                        r1 2 2

                        Country4: e(lags)[1,3]
                        aa dollar
                        r1 1 1

                        Country5: e(lags)[1,3]
                        aa dollar
                        r1 1 2

                        Country6: e(lags)[1,3]
                        aa dollar
                        r1 3 3

                        Country7: e(lags)[1,3]
                        aa dollar
                        r1 0 1

                        Country8: e(lags)[1,3]
                        aa dollar
                        r1 1 3

                        Country9: e(lags)[1,3]
                        aa dollar
                        r1 0 2

                        Country10: e(lags)[1,3]
                        aa dollar
                        r1 2 1

                        If I get the result above, how can I select my lag for AA and Dollar??
                        Then how to set up the code to run the xtpmg command??

                        Please help me.

                        Best regards,
                        Last edited by GwanSeon Kim; 09 Apr 2018, 21:06.

                        Comment

                        Working...
                        X