Announcement

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

  • ARDL: updated Stata command for the estimation of autoregressive distributed lag and error correction models

    Dear Statalisters and users of our ardl command,

    We are happy to announce that a major update of the ardl command (version 1.0.0) is available for installation from my website:
    Code:
    . net install ardl, from(http://www.kripfganz.de/stata/)
    If you are already using the command, type the following to upgrade to the latest version:
    Code:
    . adoupdate ardl, update
    The most important change concerns the Pesaran, Shin, and Smith (2001) bounds testing procedure. The bounds test is now performed by the new postestimation command estat ectest. Instead of the Pesaran, Shin, and Smith (2001) near-asymptotic critical values and the Narayan finite-sample critical values, the new command now displays our more precise Kripfganz and Schneider (2018) critical values. These critical values have been obtained with response surface regressions based on large-scale simulations and they are available for any sample size and any number of regressors, and they also properly account for the number of short-run coefficients in the model. In addition, the command now produces approximate p-values that allow for an easy test decision given a desired significance level. Both finite-sample and asymptotic critical values / p-values are available. The response surface methodology is explained in detail in a manuscript available on my website (see the references below) that also documents the regression results used to predict the critical values and the p-values. (The previous postestimation command estat btest is now obsolete but previous do-files continue to work!)

    The bounds test for the t-statistic is now also displayed in cases 2 and 4 with restricted deterministic model components. The critical values are identical to those from cases 3 and 5, respectively. (See again the manuscript on my website referenced below for details.)

    Here is a basic example. The first regression shows the ARDL model results (level representation), the second regression displays the error correction representation of the same model, and the final output shows the bounds test results with our new finite-sample critical values and approximate p-values:
    Code:
    . webuse lutkepohl2
    (Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1)
    
    . ardl ln_inv ln_inc ln_consump
    
    ARDL(1,0,2) regression
    
    Sample: 1961q1 - 1982q4                         Number of obs     =         88
                                                    F(   5,     82)   =    1990.82
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.9918
                                                    Adj R-squared     =     0.9913
    Log likelihood =  158.83176                     Root MSE          =     0.0412
    
    ------------------------------------------------------------------------------
          ln_inv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          ln_inv |
             L1. |   .8432219   .0588646    14.32   0.000     .7261214    .9603224
                 |
          ln_inc |  -.4477328   .3143463    -1.42   0.158    -1.073068    .1776022
                 |
      ln_consump |
             --. |     1.9247   .5487929     3.51   0.001     .8329761    3.016424
             L1. |  -.3682414   .5622263    -0.65   0.514    -1.486689    .7502058
             L2. |  -.9598887   .4300221    -2.23   0.028     -1.81534   -.1044377
                 |
           _cons |  -.0460065   .0706528    -0.65   0.517    -.1865575    .0945445
    ------------------------------------------------------------------------------
    
    . ardl ln_inv ln_inc ln_consump, ec
    
    ARDL(1,0,2) regression
    
    Sample: 1961q1 - 1982q4                         Number of obs     =         88
                                                    R-squared         =     0.2228
                                                    Adj R-squared     =     0.1754
    Log likelihood =  158.83176                     Root MSE          =     0.0412
    
    ------------------------------------------------------------------------------
        D.ln_inv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    ADJ          |
          ln_inv |
             L1. |  -.1567781   .0588646    -2.66   0.009    -.2738786   -.0396776
    -------------+----------------------------------------------------------------
    LR           |
          ln_inc |  -2.855838   2.522611    -1.13   0.261    -7.874116     2.16244
                 |
      ln_consump |
             --. |   3.805188   2.600013     1.46   0.147    -1.367067    8.977442
    -------------+----------------------------------------------------------------
    SR           |
      ln_consump |
             D1. |    1.32813    .410621     3.23   0.002     .5112741    2.144986
             LD. |   .9598887   .4300221     2.23   0.028     .1044377     1.81534
                 |
           _cons |  -.0460065   .0706528    -0.65   0.517    -.1865575    .0945445
    ------------------------------------------------------------------------------
    
    . estat ectest
    
    Pesaran, Shin, and Smith (2001) bounds test
    
    H0: no level relationship                                        F =     4.069
    Case 3                                                           t =    -2.663
    
    Finite sample (2 variables, 88 observations, 2 short-run coefficients)
    
    Kripfganz and Schneider (2018) critical values and approximate p-values
    
       | 10%              | 5%               | 1%               | p-value         
       |    I(0)     I(1) |    I(0)     I(1) |    I(0)     I(1) |    I(0)     I(1)
    ---+------------------+------------------+------------------+-----------------
     F |   3.215    4.193 |   3.887    4.957 |   5.395    6.637 |   0.041    0.111
     t |  -2.564   -3.224 |  -2.875   -3.558 |  -3.484   -4.199 |   0.081    0.253
    
    do not reject H0 if
        both F and t are closer to zero than critical values for I(0) variables
          (if p-values > desired level for I(0) variables)
    reject H0 if
        both F and t are more extreme than critical values for I(1) variables
          (if p-values < desired level for I(1) variables)
    Please see the Stata help files for details:
    Code:
    . help ardl
    . help ardl postestimation
    . help ardlbounds
    The update includes the following additional improvements:
    • The Mata-based lag selection algorithm that was introduced in Version 0.7.0 as an option is now the default. This speeds up the ardl command substantially (by more than factor 10).
    • Improved display of the header above the estimation table.
    • Improved help file.
    • Some bug fixes.
    References:
    • Bounds test:
      • Pesaran, M. H., Y. Shin, and R. J. Smith (2001). Bounds testing approaches to the analysis of level relationships. Journal of Applied Econometrics 16 (3), 289–326, doi.org/10.1002/jae.616
    • New critical value bounds and approximate p-values for the bounds test:
      • Kripfganz, S. and D. C. Schneider (2018). Response surface regressions for critical value bounds and approximate p-values in equilibrium correction models. Manuscript, University of Exeter and Max Planck Institute for Demographic Research, www.kripfganz.de/research/Kripfganz_Schneider_ec.html
    • Stata command (some of the slides are now outdated):
    • Mata implementation of the fast lag selection algorithm:
      • Kripfganz, S., and D. C. Schneider (2017). Speeding up the ARDL estimation command: A case study in efficient programming in Stata and Mata. Presented June 23, 2017, at the German Stata Users Group Meeting, Berlin, repec.org/dsug2017/Germany17_Schneider.pdf
    For additional references, see the Stata help file and the references in the above articles / presentations.

    Please use this new Statalist topic for any questions concerning the new version of the command. A Statalist discussion about previous versions of the ardl command can be found here: ARDL in Stata.
    https://twitter.com/Kripfganz

  • #2
    Hi Sebastian,

    I have the latest ardl version (1.0.0) running on my Mac. However, when replicating your example, I get the following error after the estat ectest command:

    Code:
    file /Library/Application Support/Stata/ado/plus//.dta not found
    Do you know how to fix this?

    Thanks for your help!

    Comment


    • #3
      Thanks a lot for flagging this problem. It appears to be a Mac-specific issue about locating files. I have just released an update to version 1.0.1 that should circumvent this problem.
      Code:
      adoupdate ardl, update
      https://twitter.com/Kripfganz

      Comment


      • #4
        Hi,
        I've replicated exactly the same procedure as you, but still cannot estimate an error correction model
        I am getting the following error whenevr I try ''expression too long''

        Comment


        • #5
          Originally posted by Oumayma Bahammou View Post
          I've replicated exactly the same procedure as you, but still cannot estimate an error correction model
          I am getting the following error whenevr I try ''expression too long''
          Welcome to the forum. Please show us the exact command lines as you have typed them in Stata and post the exact output displayed by Stata. Otherwise, we do not have a chance to find out what might have gone wrong.
          (Please see the Statalist FAQs on how to post Stata code with CODE delimiters.)
          https://twitter.com/Kripfganz

          Comment


          • #6
            Originally posted by Sebastian Kripfganz View Post
            Welcome to the forum. Please show us the exact command lines as you have typed them in Stata and post the exact output displayed by Stata. Otherwise, we do not have a chance to find out what might have gone wrong.
            (Please see the Statalist FAQs on how to post Stata code with CODE delimiters.)
            Hi,
            This is the error I get:
            Click image for larger version

Name:	error.png
Views:	1
Size:	343.7 KB
ID:	1438360

            Comment


            • #7
              Oumayma Bahammou
              It seems that there might be a problem with running ardl on Small Stata.

              May I ask you to run the following code from a do-file. This shall create a Stata log file named ardl.smcl in your working directory. If you could send this log file to me by e-mail, I can have a look into it and try to find out whether we can provide a fix for the problem. (You can find my e-mail address at the very end of the ardl help file.)
              Code:
              set more off
              log using ardl, smcl
              webuse lutkepohl2, clear
              set trace on
              ardl ln_consump ln_inc , lags(1) ec
              set trace off
              loc close
              https://twitter.com/Kripfganz

              Comment


              • #8
                Originally posted by Sebastian Kripfganz View Post
                Oumayma Bahammou
                It seems that there might be a problem with running ardl on Small Stata.

                May I ask you to run the following code from a do-file. This shall create a Stata log file named ardl.smcl in your working directory. If you could send this log file to me by e-mail, I can have a look into it and try to find out whether we can provide a fix for the problem. (You can find my e-mail address at the very end of the ardl help file.)
                Code:
                set more off
                log using ardl, smcl
                webuse lutkepohl2, clear
                set trace on
                ardl ln_consump ln_inc , lags(1) ec
                set trace off
                loc close
                I've sent you a mail with log file attached.
                Thanks a lot for your help.

                Comment


                • #9
                  Thank you for sending the log file. Unfortunately, there is no way to provide an easy fix for this problem that indeed only occurs under Small Stata (which is no longer sold by StataCorp). I hope you can get access to a different version of Stata instead.
                  https://twitter.com/Kripfganz

                  Comment


                  • #10
                    Originally posted by Sebastian Kripfganz View Post
                    Thank you for sending the log file. Unfortunately, there is no way to provide an easy fix for this problem that indeed only occurs under Small Stata (which is no longer sold by StataCorp). I hope you can get access to a different version of Stata instead.
                    Thanks a lot for your help.

                    Comment


                    • #11
                      • I have a problem with the installation.
                      Attached Files

                      Comment


                      • #12
                        I received a request as a private message that I want to answer publicly because I believe others might benefit from the answers as well:1
                        Unfortunately i am not able to conduct post estimation of autocorelation, heteroscedastict, Specification test. I am using this code after running the ARDL code as the postestimation command:

                        estat dwatson
                        estat archim
                        estat hottest
                        estat ovtest
                        estat vif

                        ​Therefore, can you please guide me how to do this post estimation.
                        If you store the underlying regress estimation results with the ardl option regstore(), you can subsequently recover these estimation results and then use the standard regress postestimation commands, e.g.
                        Code:
                        . webuse lutkepohl2
                        . ardl ln_inv ln_inc ln_consump, regstore(ardl)
                        . estimates restore ardl
                        . estat dwatson
                        . estat archlm
                        . estat hettest
                        . estat ovtest
                        . estat vif
                        For a list of available postestimation commands that can be used following this procedure, see
                        Code:
                        help regress postestimation
                        help regress postestimation time series
                        For more information on the ardl command and its regstore() option, as well as specific postestimation commands available directly after ardl, see
                        Code:
                        help ardl
                        help ardl postestimation
                        --
                        1 In general, please post your questions publicly here on Statalist. First, your questions might be of general interest. Second, it is much easier to respond to the questions here in the forum than by e-mail due to the possibility of easily posting code and estimation output.
                        https://twitter.com/Kripfganz

                        Comment


                        • #13
                          @Sebastian Kripfganz I met the same install problem as post#11, and always reported errors, as following:

                          net install ardl, from(http://www.kripfganz.de/stata/)
                          connection timed out -- see help r(2) for troubleshooting
                          http://www.kripfganz.de/stata/ either
                          1) is not a valid URL, or
                          2) could not be contacted, or
                          3) is not a Stata download site (has no stata.toc file).
                          r(2);


                          could you please email the package to [email protected] or list another install adress? appreciate you greatly.

                          Comment


                          • #14
                            Thanks to Kit Baum, the latest version 1.0.2 of the ardl command is now also available for installation from SSC:
                            Code:
                            ssc install ardl
                            This might be helpful for all those who cannot directly install the command from my personal website, for example due to firewall restrictions, but we might less frequently update the SSC version.

                            The critical values for the bounds test slightly changed in this version because we fixed a small mistake in the underlying response surface regressions.

                            In addition, my presentation slides about the ardl command from the 2018 London Stata Conference are now available as well:
                            https://twitter.com/Kripfganz

                            Comment


                            • #15
                              Dear Sebastian,

                              Many thanks for developing ARDL for Stata, it has been a very useful tool for my work so far. I am writing to clarify something that is mentioned in your slides (from the London Stata conference) regarding the output produced by ardl with ec representation. Specifically, I refer to slide 16 on the interpretation, where you mention that the LR coefficients "correspond to the negative cointegration coefficients after normalizing the coefficient of the dependent variable to unity" and the (negative) speed of adjustment coefficient (ADJ) is reported as (minus) \alpha.

                              So from the results you report on slide 15, does this mean that:
                              1. The speed of adjustment is negative and significant, therefore the long-run relationship exists and is converging?
                              2. The coefficient of income on consumption is (plus) 0.967 and is therefore positively related to consumption?
                              3. If you have exogenous variables (that enter only in SR), then the sign of these coefficients are reported as is (e.g. if negative sign, then negatively related to consumption)
                              Sorry if this appears to be a basic question, since from what I understood of the output from -vec-, you need to be careful while taking the signs from the output as they are since the negative adjustment coefficient will change the sign of the resulting LR coefficients produced at the end (e.g. if there is a negative sign, then when writing out the actual cointegrating relationship, it is considered a positive relationship, since the sign of the adjustment coefficient is also negative).

                              Thanks in advance for your help.

                              Anirudh

                              Comment

                              Working...
                              X