Announcement

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

  • Ronak Parikh
    replied
    Dear Sebastian,

    Thank you very much - when I execute the following code (with my regression), I receive the following output:

    quietly ardl lngdp lnpatents consumption, lags(4 4 4) ec regstore(ardlreg)
    quietly estimates restore ardlreg
    local cmdline ‘"‘e(cmdline)’"’
    gettoken cmd cmdline : cmdline
    newey ‘cmdline’ lag(4)
    ‘cmdline’ invalid name

    Would you have any idea how I can fix this?

    Leave a comment:


  • Olav Hose
    replied
    Originally posted by Sebastian Kripfganz View Post
    Olav Hose
    When you estimate the model in first differences, you should not normally use the ec or ec1 option (which would create differences of differences). You estimate the model in first differences because of lack of evidence of a long-run relationship in your previous step. There is then no long-run relationship in the first-differenced model anymore.

    Alex Grisdale
    25 observations is almost always not enough for an ARDL estimation, especially with 5 independent variables. There are insufficient degrees of freedom to estimate the model, which is why there are dropped variables. Even if you remove some variables and limit the lag order with option maxlags(), inference with just 25 observations will be very unreliable.

    Ronak Parikh
    Please see slide 41 of my 2018 London Stata Conference Presentation on how to use Newey-West standard errors with ardl.
    Dear Sebastian, perfect and thank you for the reply, that make sense. In cases of no significant value of the F-test, do you know any methods of making it significant, or do I simply need to accept the fact that many of my models lacks cointegration? That would be much appreciated.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Code:
    . webuse lutkepohl2
    . quietly ardl ln_consump ln_inc, exog(L(0/3)D.ln_inv) trend(qtr) aic regstore(ardlreg)
    . quietly estimates restore ardlreg
    . local cmdline `"`e(cmdline)'"'
    . gettoken cmd cmdline : cmdline
    . newey `cmdline' lag(4)
    The local cmdline contains the corresponding command line for the regress command (excluding the command name), not the ardl command. With the ardl option regstore(), the results are stored using the regress command; these are then subsequently recovered with the estimates restore command. The newey command eventually fits the same regression.

    To see what is contained in the local cmdline, execute the above code and add the line
    Code:
    . display `"`cmdline'"'
    Last edited by Sebastian Kripfganz; 06 Apr 2023, 04:36.

    Leave a comment:


  • Ronak Parikh
    replied
    Dear Sebastian,

    Thank you very much for your fast reply - I have a question regarding slide 41: how do I interpret 'cmdline'? If my ARDL input is ardl lngdp lnpatents consumption, lags(4 4 4) ec, is this what I should write in place of 'cmdline'?



    Leave a comment:


  • Sebastian Kripfganz
    replied
    Olav Hose
    When you estimate the model in first differences, you should not normally use the ec or ec1 option (which would create differences of differences). You estimate the model in first differences because of lack of evidence of a long-run relationship in your previous step. There is then no long-run relationship in the first-differenced model anymore.

    Alex Grisdale
    25 observations is almost always not enough for an ARDL estimation, especially with 5 independent variables. There are insufficient degrees of freedom to estimate the model, which is why there are dropped variables. Even if you remove some variables and limit the lag order with option maxlags(), inference with just 25 observations will be very unreliable.

    Ronak Parikh
    Please see slide 41 of my 2018 London Stata Conference Presentation on how to use Newey-West standard errors with ardl.

    Leave a comment:


  • Ronak Parikh
    replied
    Hi, I have been running an ARDL model, but I have recently found there to be serial correlation. Is there a way to incorporate HAC standard errors into the ARDL model using the 'newey' term, when also using an error correction term (since cointegration is present)?

    Thanks!

    Leave a comment:


  • Alex Grisdale
    replied
    Dear community,
    I need your help.
    I am currently running a regression on corruptions effect on economic growth in Malaysia. The data for corruption is only available from 1995 to 2020, so I only have 25 observations. I have 5 independent variables and when I attempt to find the optimal number of lags using the ardl command it comes up with this:
    note: L2.lnGOV omitted because of collinearity.
    note: L3.lnGOV omitted because of collinearity.
    note: L4.lnGOV omitted because of collinearity.
    note: Trad omitted because of collinearity.
    note: L.Trad omitted because of collinearity.
    note: L2.Trad omitted because of collinearity.
    note: L3.Trad omitted because of collinearity.
    note: L4.Trad omitted because of collinearity.

    Any suggestions on what I can do to fix this problem would be much appreciated.
    Last edited by Alex Grisdale; 05 Apr 2023, 11:19.

    Leave a comment:


  • Olav Hose
    replied
    Originally posted by Sebastian Kripfganz View Post
    The second regression gives you the short-run effects conditional on the long-run relationship. That is, these short-run effects are the remaining effects after accounting for the adjustment to any deviation from the long-run equilibrium; the latter adjustment is governed by the speed-of-adjustment coefficient.

    In the first regression, these effects are mixed up, which makes it difficult to interpret the coefficients, but this level representation is still fine for prediction purposes.

    Please also see our forthcoming Stata Journal article:
    Thank you very much, it is very helpful. I do have another question, I have realised that many of my different ARDL estimations lacks a long-run relationship due to for example the F-test being below the lower bound. However, I do realise that when using the first difference of all the variables in the equation, the model become significant. My question is therefore, could you use the first difference of all variables in an ARDL instead of using the variables in level, or would that destroy any potential relationship in the long-run? If it is possible to use the first difference variables, would you still recommend using with EC1? All my data is either I(0) or I(1) (the large majority I(1)).

    Thank you once again!

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The second regression gives you the short-run effects conditional on the long-run relationship. That is, these short-run effects are the remaining effects after accounting for the adjustment to any deviation from the long-run equilibrium; the latter adjustment is governed by the speed-of-adjustment coefficient.

    In the first regression, these effects are mixed up, which makes it difficult to interpret the coefficients, but this level representation is still fine for prediction purposes.

    Please also see our forthcoming Stata Journal article:

    Leave a comment:


  • Olav Hose
    replied
    Hello Sebastian, first of all, thank you very much for all replies in this thread. They have been very useful for me. I am trying to perform the ARDL model in the case of finding any evidence of short-run and long-run effects how changes in the exchange rate on the trade balance. I use the trade balance as dependent variable and the exchange rate and real GDP for Sweden and the Euro area as independent variables. However, I am not sure if I should use both ardl lnC lnGDPEA lnGDPSE lnREBEX, lags(7 2 1 4) and ardl lnC lnGDPEA lnGDPSE lnREBEX, lags(7 2 1 4) ec to estimate both short-run and long-run effects? I mean, the first equation to estimate short-run effects, and the second equation to estimate long-run effects. I know that short-run estimates are presented in the second equation, but they differ from the one of the first equation? The question is, which table should I use to interpret the short-run effects?

    Thank you very much.

    Table 1
    ARDL(7,2,1,4) regression
    Sample: 1996q4 thru 2022q3 Number of obs = 104
    F(17, 86) = 1220.17
    Prob > F = 0.0000
    R-squared = 0.9959
    Adj R-squared = 0.9951
    Log likelihood = 214.77285 Root MSE = 0.0337
    lnC Coefficient Std. err. t P>t [95% conf. interval]
    lnC
    L1. 1.629482 .0956644 17.03 0.000 1.439307 1.819656
    L2. -.8719938 .1541952 -5.66 0.000 -1.178524 -.565464
    L3. .1916431 .1215106 1.58 0.118 -.0499119 .4331981
    L4. .535612 .1160356 4.62 0.000 .3049408 .7662832
    L5. -1.222609 .1205385 -10.14 0.000 -1.462232 -.9829863
    L6. 1.093014 .1469945 7.44 0.000 .8007987 1.38523
    L7. -.4022034 .0893606 -4.50 0.000 -.5798465 -.2245603
    lnGDPEA
    -. -.005067 .3845419 -0.01 0.990 -.769511 .759377
    L1. .1248658 .3936466 0.32 0.752 -.6576778 .9074094
    L2. .1047407 .2237506 0.47 0.641 -.3400608 .5495422
    lnGDPSE
    -. -.0580641 .4912167 -0.12 0.906 -1.034571 .9184424
    L1. -.1288229 .4985562 -0.26 0.797 -1.11992 .862274
    lnREBEX
    -. .1235633 .1862408 0.66 0.509 -.2466711 .4937977
    L1. .0304421 .2450259 0.12 0.901 -.4566532 .5175374
    L2. -.2024231 .2440323 -0.83 0.409 -.6875432 .2826969
    L3. -.0788881 .2484374 -0.32 0.752 -.5727653 .4149891
    L4. .0777871 .1745874 0.45 0.657 -.2692811 .4248554
    _cons -.1458299 .6765544 -0.22 0.830 -1.490776 1.199116
    Table 2
    ARDL(7,2,1,4) regression
    Sample: 1996q4 thru 2022q3 Number of obs = 104
    R-squared = 0.6862
    Adj R-squared = 0.6242
    Log likelihood = 214.77285 Root MSE = 0.0337
    D.lnC Coefficient Std. err. t P>t [95% conf. interval]
    ADJ
    lnC
    L1. -.0470552 .0201807 -2.33 0.022 -.0871731 -.0069373
    LR
    lnGDPEA 4.771832 6.996606 0.68 0.497 -9.13696 18.68062
    lnGDPSE -3.971654 3.18677 -1.25 0.216 -10.30674 2.363435
    lnREBEX -1.052353 2.293742 -0.46 0.648 -5.612162 3.507455
    SR
    lnC
    LD. .6765369 .0943641 7.17 0.000 .4889473 .8641265
    L2D. -.1954569 .0869558 -2.25 0.027 -.3683194 -.0225944
    L3D. -.0038138 .0732101 -0.05 0.959 -.1493507 .1417231
    L4D. .5317981 .0708273 7.51 0.000 .3909981 .6725982
    L5D. -.6908108 .084403 -8.18 0.000 -.8585985 -.5230231
    L6D. .4022034 .0893606 4.50 0.000 .2245603 .5798465
    lnGDPEA
    D1. -.2296065 .434838 -0.53 0.599 -1.094036 .6348229
    LD. -.1047407 .2237506 -0.47 0.641 -.5495422 .3400608
    lnGDPSE
    D1. .1288229 .4985562 0.26 0.797 -.862274 1.11992
    lnREBEX
    D1. .173082 .1681912 1.03 0.306 -.161271 .507435
    LD. .2035241 .1683902 1.21 0.230 -.1312245 .5382726
    L2D. .0011009 .171996 0.01 0.995 -.3408158 .3430177
    L3D. -.0777871 .1745874 -0.45 0.657 -.4248554 .2692811
    _cons -.1458299 .6765544 -0.22 0.830 -1.490776 1.199116
    Last edited by Olav Hose; 03 Apr 2023, 04:04.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Since esttab is a wrapper for estout, you should be able to add r() results to your output table. As this is not specifically related to the ardl package, I recommend to start a new topic where others with more experience in this regard might be able to help. Alternatively, have a look at Ben Jann's new sttex package: https://www.statauk.timberlake-confe...om/proceedings
    Last edited by Sebastian Kripfganz; 27 Sep 2022, 04:16.

    Leave a comment:


  • Louise Jensen
    replied
    POST #324:
    Originally posted by Sebastian Kripfganz View Post
    Here is an algorithm that should work:
    Code:
    webuse lutkepohl2
    ardl ln_consump ln_inc ln_inv, ec
    
    loc varname "ln_inv"
    
    local lag = el(e(lags), 1, colnumb(e(lags), "`varname'"))
    local --lag // the number of lags in the EC form is one less than the number of lags in levels
    
    if `lag' >= 0 {
    loc lagsum "D.`varname'"
    loc laglist "D.`varname'"
    forv l = 1/`lag' {
    loc lagsum "`lagsum' + L`l'D.`varname'"
    loc laglist "`laglist' L`l'D.`varname'"
    }
    lincom `lagsum'
    test `laglist'
    }
    ardl stores the number of lags in the level representation of the model in the matrix e(lags). The relevant lag order can be extracted from that matrix. The above code can be easily adjusted to work with the ec1 instead of the ec option by removing the if `lag' >= 0 condition.
    Dear Professor Kripfganz

    I have used your code above to get a lincom result for each ardl regression, however my problem is that I have 133 ardl regressions and at least 133 results. I would like to get the lincom results as an output to Latex, but I can't seem to figure it out. Do you know how to use e.g. outreg for the lincom results for each regression? I am currently using esttab for the regressions results.

    Thanks in advance.

    My code:

    forval i = 1/133{
    eststo res`i': ardl fpidif faoalldif oildif exc_div if (id == `i'), lags(4 4 4 4) aic ec
    loc varname "faoalldif"

    local lag = el(e(lags), 1, colnumb(e(lags), "`varname'"))
    local --lag // the number of lags in the EC form is one less than the number of lags in levels

    if `lag' >= 0 {
    loc lagsum "D.`varname'"
    loc laglist "D.`varname'"
    forv l = 1/`lag' {
    loc lagsum "`lagsum' + L`l'D.`varname'"
    loc laglist "`laglist' L`l'D.`varname'"
    }
    lincom `lagsum'
    test `laglist'
    }
    }
    esttab using ardl_log.tex, se starlevels(* 0.1 * 0.05 ** 0.01) replace tex

    Best regards
    Louise

    Leave a comment:


  • wanhaiyou
    replied
    Originally posted by Sebastian Kripfganz View Post
    In that case, you would need to impose a minimum lag order of 1. That might be a little less efficient but I would not worry much about it.
    OK, I do appreciate your help! Thanks for your time!

    Bests,
    wanhai

    Leave a comment:


  • Sebastian Kripfganz
    replied
    In that case, you would need to impose a minimum lag order of 1. That might be a little less efficient but I would not worry much about it.

    Leave a comment:


  • wanhaiyou
    replied
    Originally posted by Sebastian Kripfganz View Post
    The difficulty here is that the optimal lag order for ln_inc is zero, but you are forcing it to appear in the first lag in the EC representation (option ec1). This is achieved by effectively imposing a constraint as follows:
    Code:
    ardl ln_consump ln_inc ln_inv, lags(1 0 4) ec1
    constraint 1 L.ln_inc = D.ln_inc
    cnsreg D.ln_consump L.ln_consump L.ln_inc L.ln_inv D.ln_inc L(0/3)D.ln_inv if e(sample), constraints(1)
    The long-run coefficients in the ardl output are a nonlinear coefficient combination:
    Code:
    nlcom (- _b[L.ln_inc] / _b[L.ln_consump]) (- _b[L.ln_inv] / _b[L.ln_consump])
    If you use the ec instead of the ec1 option, this complication does not arise and you can replicate the results directly with regress:
    Code:
    ardl ln_consump ln_inc ln_inv, lags(1 0 4) ec
    reg D.ln_consump L.ln_consump ln_inc ln_inv L(0/3)D.ln_inv if e(sample)
    nlcom (- _b[ln_inc] / _b[L.ln_consump]) (- _b[ln_inv] / _b[L.ln_consump])

    Dear professor, I have another question. As you mentioned in the previous post, when the optimal lag order for x is zero, and we still estimate the model in the EC representation (option ec1).
    At this time, this is achieved by effectively imposing a constraint. However, some routines, such as sqreg (quantile regression), the option constraints(1) is not allowed. That is, we cannot
    estimate this model with constraint. Do you have any suggestions?

    Greats thank!

    wanhai

    Leave a comment:

Working...
X