Announcement

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

  • CS-ARDL Approach xtdcce2

    Hi All,

    Does the xtdcce2 stata command has limitation regarding, how many explanatory variables should we include in the model?

    Regards,
    Marwan

  • #2
    Hi Marwan,
    there are two limitations which might be important. The first one is a technical one and depends on your Stata version, the second one is econometric theory driven.

    Internally xtdcce2 creates temporary variables for the cross-sectional averages and time series and factor variables. For example if you use L.y, then xtdcce2 creates a variable for this. If xtdcce2 reaches the maximum of Stata variables, then of course, there is no way around it. In general, I tried to code the program as light as possible, i.e. avoid creating too many variables. The same holds true for the maximum matrix size. Most of the calculations are in mata and there is no real limit to the matrix size, but xtdcce2 posts results in Stata matrices, which have a maximum. Once again, this depends on your PC and Stata version.

    On the other hand there is a limit in terms of econometrics and I think this limitation is more important. Obviously, if the number of observations is smaller than the number of explanatory variables including the cross sectional averages, then a regression is not possible. Furthermore xtdcce2 checks for each cross-section, if there are enough periods over time to estimate the cross-section unit specific coefficients. If there are not, then xtdcce2 automatically drops this cross section. As an indication, xtdcce2 displays two degrees of freedom per group, one with cross-sectional averages, the other one without. If both are small, then maybe you should reduce the number of explanatory variables and cross-sectional averages and their lags.

    In general, I would always ask myself: do I need variable x as an explanatory variable and how many lags of this variable do I need? Then I would ask which variables as cross-sectional averages are required and how many lags of those. xtdcce2 gives you a lot of control over this as you can define which variables and how many lags are added as cross-sectional averages.

    Hope this helps!
    Jan

    Comment


    • #3
      Many thanks Jan

      Can you please suggest for me how to adjust this PMG stata command to xtdcce2
      xtpmg d.dlogTMACN d.dlogROILPR d.dlogGDPPC dlogTMACNbar dlogROILPRbar dlogGDPPCbar ldlogTMACNbar ldlogROILPRbar ldlogGDPPCbar l2dlogTMACNbar l2dlogROILPRbar l2dlogGDPPCbar l3dlogTMACNbar l3dlogROILPRbar l3dlogGDPPCbar, lr ( l.dlogTMACN dlogROILPR dlogGDPPC) replace pmg

      Thanks


      Comment


      • #4
        Marwan,
        it is very difficult to state anything about the syntax without any information on the variables and the model you want to estimate. My guess (and this is a guess and nothing else) is, that the variables called *bar are cross sectional averages. l stands for lag, l2 for second lag and d for difference. Your command line implies there are 3 lags of the cross sectional averages and the variables included in lr() can be used in xtdcce2 as well.

        You might want to start with a command line like:
        Code:
        xtdcce2 d.logTMACN d.dlogROILPR d.dlogGDPPC , crosssectional(L(0/3).(d.logTMACN d.dlogROILPR d.dlogGDPPC)) cr_lags(3) lr(l.dlogTMACN dlogROILPR dlogGDPPC)
        This might be a starting point, however please check it if it fits your model!
        Last edited by JanDitzen; 28 Jan 2019, 06:46.

        Comment


        • #5
          Hi Jan,

          Many thanks for sending this command. I have implemented but. it says option crlags() not allowed

          Regards,

          Marwan

          Comment


          • #6
            It should mean cr_lags(). sorry for the typo!

            Comment


            • #7
              It still shows problem

              timevar (time) may not contain missing values when option full is specified

              Comment


              • #8
                There is an issue with your dataset rather than xtdcce2. The variable you use to specify the time dimension (her apparently time) has missing values. Obviously this is a problem as Stata does not know what to do with these observations. You will see the observations if you type something like:
                Code:
                list if time == .
                If nothing shows up there, then you are ready to go. xtdcce2 is very strict and does not allow for any missing values in the time or unit dimension.

                Comment


                • #9
                  Hi Jan

                  But my data works with xtpmg has no problem with it..........So, How can I type this ????????? Is this one lag order ......

                  xtdcce2 d.logTMACN d.dlogROILPR d.dlogGDPPC , crosssectional(L(0/3).(d.logTMACN d.dlogROILPR d.dlogGDPPC)) cr_lags(3) lr(l.dlogTMACN dlogROILPR dlogGDPPC)

                  Comment


                  • #10
                    xtdcce2 and xtpmg are different programs and thus they do different things and have different requirements on the datasets. Internally xtdcce2 uses tsfill, full to make sure the panel is balanced and to create an internal time variable. This variable is important to make sure the lag structure for the cross sectional averages remains correct. If the panel or time identifier variable contain a missing observation, xtpmg will automatically discard this observation, xtdcce2 cannot do this for the reason mentioned.

                    Your data seems to contain at least one observations with a missing in the time variable. As I said, if you use
                    Code:
                    list if time == .
                    then Stata will tell you which ones. Then you need to remove or treat the observations.

                    Comment


                    • #11
                      I will try to fill the missing observation and re-try it again.

                      I also came across one of your paper xtdcce.............So, how is different from xtdcce2................So, does xtdcce2 estimates PMG ?? if so, what is the Stata command.

                      Many thanks for your help....

                      Please keep in touch

                      Comment


                      • #12
                        xtdcce was a very early version of xtdcce2. I named it xtdcce2 to avoid any conflicts with potential official Stata Corp. commands. xtdcce2 is much further developed and I would strongly advise against the use of the old xtdcce!
                        The paper explaining xtdcce was an early version of my Stata Journal paper. As with the command, I would strongly suggest to refer to the published version of the paper.

                        Comment


                        • #13
                          Jan sorry for the keeping posting you

                          The code still gives me an error

                          xtdcce_m_selectindex(): 3499 selectindex() not found
                          <istmt>: - function returned error

                          Even I used the data from Chudik et al. (2013) that you have used before by implementing this command

                          xtdcce2133 d.y , lr(L.d.y L.dp dp L.d.gd d.gd) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample

                          xtdcce2133 d.y , lr(L(1/3).(d.y) (L(0/3).dp) (L(0/3).d.gd) ) lr_options(ardl) cr(d.y dp d.gd) cr_lags(3) fullsample

                          CS-ARDL Example - ARDL(1,1,1) from Chudik et al. (2013, Table 17).

                          Comment


                          • #14
                            You are using a Stata version prior to Stata 13. Can you please update xtdcce2 to the latest version (v.134). To update xtdcce2, please uninstall all version of xtdcce2 (click on help -> SJ and community written programs -> and then click o uninstall of all xtdcce2 version.). To install the latest version please type in Stata

                            Code:
                            net from "https://janditzen.github.io/xtdcce2/"
                            In case your Stata version does not allow to download from https, you can download xtdcce2 by hand here or here and save it into your ado directory. Hopefully that helps.

                            Comment

                            Working...
                            X