Announcement

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

  • Help with xtdcce2

    Dear community,

    I am trying to implement CS-ARDL model via xtdcce2. I am using 9 countries and 1990-2018 data and the version of stata is Stata15. My dependent variable is lnrene and independent variables are lnee lnei lnrenexp lngdp. While trying to implement, I get the following output:

    xtdcce2 d.lnrene, lr(lnee lnei lnrenexp lngdp ) lr_options(ardl) cr(lnrene lnee lnei lnrenexp lngdp) cr_lags(0) reportconstant
    (Dynamic) Common Correlated Effects Estimator - Mean Group (CS-ARDL)

    Panel Variable (i): id Number of obs = 252
    Time Variable (t): year Number of groups = 9

    Degrees of freedom per group: Obs per group (T) = 28
    without cross-sectional averages = 23
    with cross-sectional averages = 18
    Number of F(90, 162) = 0.91
    cross-sectional lags 0 to 0 Prob > F = 0.68
    variables in mean group regression = 45 R-squared = 0.66
    variables partialled out = 45 R-squared (MG) = 0.13
    Root MSE = 0.30
    CD Statistic = 0.94
    p-value = 0.3471

    D.lnrene Coef. Std. Err. z P>z [95% Conf. Interval]

    Short Run Est.

    Mean Group:
    _cons -28.25181 35.35791 -0.80 0.424 -97.55203 41.04842
    lnee -.2653635 .156287 -1.70 0.090 -.5716804 .0409535
    lnei 1.021577 1.380035 0.74 0.459 -1.683241 3.726396
    lnrenexp .8543453 .1945932 4.39 0.000 .4729497 1.235741
    lngdp -1.536072 5.506146 -0.28 0.780 -12.32792 9.255776

    Adjust. Term

    Mean Group:
    lr_lnee -1.265363 .156287 -8.10 0.000 -1.57168 -.9590465

    Long Run Est.

    Mean Group:
    lr__cons -29.04499 35.69681 -0.81 0.416 -99.00946 40.91948
    lr_lnei 1.123589 1.389903 0.81 0.419 -1.600571 3.847748
    lr_lngdp -.6887734 5.26852 -0.13 0.896 -11.01488 9.637337
    lr_lnrenexp .6296933 .1234743 5.10 0.000 .3876882 .8716984

    Mean Group Variables: _cons
    Cross Sectional Averaged Variables: lnrene lnee lnei lnrenexp lngdp
    Long Run Variables: lr__cons lr_lnei lr_lngdp lr_lnrenexp
    Adjustment variable(s): lr_lnee (lnee)

    Now, here, it says that the adjustment term says is lr_lnee (lnee). Is it error correction term they are referring to? I mean is the adjustment term=error correction term or ECT? If it is ECT, then where is the long-run coefficient of lnee? If it is not the ECT term and really is the long-run coefficient of lnee, then how do I get the ECT term for CS-ARDL? I applied the following commands as per as the thread of statalist goes:

    ssc uninstall xtdcce2

    package xtdcce2 from http://fmwww.bc.edu/repec/bocode/x
    'XTDCCE2': module to estimate heterogeneous coefficient models using common correlated effects in a dynamic panel

    (package uninstalled)

    . net install xtdcce221 , from("https://janditzen.github.io/xtdcce2/")
    checking xtdcce221 consistency and verifying not already installed...

    the following files already exist and are different:
    c:\ado\plus\x\xtset2.sthlp
    c:\ado\plus\x\xtcd2.ado
    c:\ado\plus\x\xtcd2.sthlp
    c:\ado\plus\x\xtdcce2_auxiliary.ado

    no files installed or copied
    (no action taken)
    r(602);

    As you can see, I tried uninstalling the old command and tried to add the new command as Dr JanDitzen recommended but it is not working. So how do I get the ECT term out of CS-ARDL, please? Please help.
    Last edited by Muhammad Ibrahim Shah; 01 Nov 2021, 18:03.

  • #2
    Dear Muhammad,
    Thank you very much for your interest in xtdcce2. First of all can you please install the latest version of xtdcce2 (it is version 3) from GitHub. You can do so by typing:

    net install xtdcce2 , from(https://janditzen.github.io/xtdcce2/)

    Please remove all version of xtdcce2 beforehand.

    Please note that for CCE estimators and thus the CS-ARDL estimator, both the time dimension and the cross-sectional dimension need to be large. Your cross-sectional dimension is 9, which is very little and thus will lead to biased results. Your time dimension is not very large either. I would strongly advice against the use of CCE estimators in such as setting. I am afraid to be so blunt, but results will be unreliable.

    On your questions: the adjustment is indeed lr_lnee in your model with a coefficient of -1.26. The coefficient already tells you that the process is instable as it is larger than 1.

    In case you want to estimate an ARDL(1,1,1..) model, you add the first differences in the short run term and the first lag of the long ran variables in the LR term. Please see more info at the Stata Journal paper here:

    https://journals.sagepub.com/doi/ful...6867X211045560

    A working paper can be found here:

    https://ideas.repec.org/p/bzn/wpaper/bemps81.html

    Hopefully this helps.

    Comment


    • #3
      Dear Professor, I didn't know that you would reply in my mail also. So let us continue our conversation here so as to benefit other members of this beloved community. I am getting the following:

      ssc uninstall xtdcce2

      package xtdcce2 from http://fmwww.bc.edu/repec/bocode/x
      'XTDCCE2': module to estimate heterogeneous coefficient models using common correlated effects in a dynamic panel

      (package uninstalled)

      . net install xtdcce2 , from(https://janditzen.github.io/xtdcce2/
      ) required
      r(100);

      . net install xtdcce2 , from(https://janditzen.github.io/xtdcce2/)
      checking xtdcce2 consistency and verifying not already installed...

      the following files already exist and are different:
      c:\ado\plus\x\xtset2.sthlp
      c:\ado\plus\x\xtdcce2_auxiliary.ado

      no files installed or copied
      (no action taken)
      r(602);

      . ssc uninstall xtset2
      package not found
      r(111);

      . ssc uninstall xtset2.sthlp
      package not found
      r(111);




      In your opinion, what is the ideal value of N (country) and T(time series) for getting a better outcome out of xtdcce2?

      Thank you so much!

      Comment


      • #4
        Can you please run

        [CODE]net install xtdcce2 , from(https://janditzen.github.io/xtdcce2/) force[\CODE]

        this will overwrite existing files

        On the dimension: this depends on your model. My advice would be to make sure you have a sufficient large degree of freedom in both dimensions. However I would suggest to have at least 25-30, so your T might actually be in an order which is tolerable.

        Comment


        • #5
          Dear Professor, Thank you. It ran successfully! I have several other questions, I hope you don't mind. Ignoring the fact that I have only 9 countries, please consider these qs in general:

          1. Is it possible to get the country-wise results from CS-ARDL model? I mean, for example, I am dealing with 9 countries (it can be more than that, i am talking in a general sense), is it possible to get results for each individual country from this code like in pooled mean group/augmented mean group? I tried writing "full" after the CS-ARDL command:

          xtdcce2 d.lnrene, lr(lnee lnei lnrenexp lngdp ) lr_options(ardl) cr(lnrene lnee lnei lnrenexp lngdp) cr_lags(0) reportconstant full

          it gives me scattered results where I don't know which are short-run and which are long run, where are ECT etc. Is it alright? Is it better to stick with only the panel model when it comes to CS-ARDL, not individual result?

          2. Can I determine via any tests how many lags should there be for each variable? For example, when selecting between panel ARDL (MG,PMG,DFE), stata provides a code to determine what should be the optimal lag for a model. Is there any way to determine the lag criterion for CS-ARDL? How do I know whether I should select ARDL(1,1,1,1) or ARDL(0,0,1,0,1)? Is it completely arbitrary?

          3. Is there any way to get post estimation dialogistic tests after CS-ARDL? I tried estat hettest for heteroscedasticity but I get an error message: box or bar must be specified.

          4. I get R squared and R squared(MG) from the result. Is R squared (MG) =adjusted R square? If not, how to get an adjusted R square?

          I am sorry for asking too many questions at once. I really want to learn!

          Comment


          • #6
            Hi Muhammad,
            on your questions:
            1) xtdcce2 returns the individual results in e(bi). In addition estat ebi returns a table with the individual results.
            2) Which program do you use to select the lags for MG, PMG, DFE? You should be able to use the same one. However lag selection in panels with heterogeneous slopes is a very scarce topic.
            3) Heteroscedasticity is no issue for the MG estimator because the variance/covariance estimator solely relies on the difference between the individual and the mean group estimates. estat hettest is not supported by xtdcc2. Please see the helpfile to see what postestimation commands are possible.
            4) For a MG regression you should use the R2(MG). xtdcce2 calculates the adjusted R2 in the background and saves it in the scalar e(r2_a).

            Hope this helps.
            Best,
            Jan

            Comment


            • #7
              Thank you so much! When I put estat ebi after cs-ardl command, what I get is only long-run result. Is that okay? Or I am supposed to get a short run as well?

              Comment


              • #8
                Depending on your model, you should see all coefficient estimates. I will check that in the next few days.

                Comment


                • #9
                  Ok, thank you. I wait for your kind response

                  Comment


                  • #10
                    Hi professor JanDitzen if I have 150+ countries and 25/30 years of data. Is it possible to apply CS-ARDL/CS-DL/DCCE-MG?

                    Comment


                    • #11
                      In general you can do it. Chudik et. al (2016, see here) present simulations results for a similar setting.

                      However, I would be careful and make sure that the length of the time series might not be enough to estimate the model, in particular if you add long run coefficients.

                      Comment


                      • #12
                        Thank you for your reply professor!

                        Comment


                        • #13
                          Dear JanDitzen, would you help me with the interpretation of r2_a (R-squared adjusted) and r2_pmg (mean group R-squared adjusted) after running xtdcce2 for a panel with many groups?
                          Is it one the max r-sq over all group panels and the other the mean r_sq over all groups?

                          xtdcce2 x L.x, nocrosssectional reportconstant
                          (Dynamic) Common Correlated Effects Estimator - Mean Group

                          Number of obs = 6057
                          Number of groups = 404

                          R-squared = 0.79
                          R-squared (MG) = 0.12


                          Thanks in advance,

                          Maria

                          Comment


                          • #14
                            Hi Maria Diaz,
                            the R2 for MG and pooled CCE is defined in Holly, Pesaran, Yamagata (2010, Journal of Econometrics; https://www.sciencedirect.com/scienc...04407610000837). Essentially the r2_pmg in amean group model is the ratio of the SSR of a model with unit specific coefficients over the total sum of squares for each cross-section individually. It indicates how much of the variation of the left hand side is explained by explanatory variables using using unit specific coefficients. The r2_pmg in a pooled model is the same but with pooled coefficients. In both cases the cross-section averages are partialled out from the model. In the pooled case the r2_pmg and the "normal" R2 are almost identical with exception that the r2_pmg has a slightly different small sample adjustment.

                            Comment


                            • #15
                              That's very helpful, thanks so much @JanDitzen!

                              Comment

                              Working...
                              X