How to display significance levels for 1%, 5%, 10% in loop
Posted: Tue Sep 15, 2015 5:01 pm
Dear Tom,
I have two questions:
I am trying to create a table "Variable", "ADF Lags", "DF Unit Root Test", "1% Crit Value", "5% Crit Value", "10% Crit Value" for each series in the loop. So my queestions are:
(1) how to display crit values for DF Unit root test
(2) how to do two loops and display the results in a table
(3) Also, I want to use l(i) instead of lisiting all the names of the variables in the header as they may change later.
I wrote the following code but it does not work:
report(action=define)
report(atrow =1, fillby=cols) "Variable" "DEPENDENT" "RGDP" "UR" "CPI" "TR3M" "TR10Y" "CRE" "HPI" "OIL" "BAA" "SP500"
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(DET=NONE, MAXLAG = 6, CRIT=AIC, PRINT, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i)) i sambeg samend
report(col=new,atrow=1,fillby=cols) "ADF Lags" %%lags
@dfunit(DET=NONE, LAGS=%%lags, METHOD = AIC, SIGNIF = 0.05, PRINT, TITLE = "Dickey-Fuller Unit Roots Test (NONE), Series " + %l(i)) i sambeg samend
report(col=new,atrow=1,fillby=cols) "DF Unit Root" %%cdstat
end dofor
report(action=show)
I tried to do it another way but it does not work either
report(action=define)
report(atrow =1, hlabels=||"Variable", "ADF Lags", "DF Unit Root"||)
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(DET=NONE, MAXLAG = 6, CRIT=AIC, PRINT, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i)) i sambeg samend
report(row=new,atcol=1) %l(i) %%lags
@dfunit(DET=NONE, LAGS=%%lags, METHOD = AIC, SIGNIF = 0.05, PRINT, TITLE = "Dickey-Fuller Unit Roots Test (NONE), Series " + %l(i)) i sambeg samend
report(row=new,atcol=2) %l(i) %%cdstat
end dofor
report(action=show)
I have two questions:
I am trying to create a table "Variable", "ADF Lags", "DF Unit Root Test", "1% Crit Value", "5% Crit Value", "10% Crit Value" for each series in the loop. So my queestions are:
(1) how to display crit values for DF Unit root test
(2) how to do two loops and display the results in a table
(3) Also, I want to use l(i) instead of lisiting all the names of the variables in the header as they may change later.
I wrote the following code but it does not work:
report(action=define)
report(atrow =1, fillby=cols) "Variable" "DEPENDENT" "RGDP" "UR" "CPI" "TR3M" "TR10Y" "CRE" "HPI" "OIL" "BAA" "SP500"
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(DET=NONE, MAXLAG = 6, CRIT=AIC, PRINT, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i)) i sambeg samend
report(col=new,atrow=1,fillby=cols) "ADF Lags" %%lags
@dfunit(DET=NONE, LAGS=%%lags, METHOD = AIC, SIGNIF = 0.05, PRINT, TITLE = "Dickey-Fuller Unit Roots Test (NONE), Series " + %l(i)) i sambeg samend
report(col=new,atrow=1,fillby=cols) "DF Unit Root" %%cdstat
end dofor
report(action=show)
I tried to do it another way but it does not work either
report(action=define)
report(atrow =1, hlabels=||"Variable", "ADF Lags", "DF Unit Root"||)
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(DET=NONE, MAXLAG = 6, CRIT=AIC, PRINT, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i)) i sambeg samend
report(row=new,atcol=1) %l(i) %%lags
@dfunit(DET=NONE, LAGS=%%lags, METHOD = AIC, SIGNIF = 0.05, PRINT, TITLE = "Dickey-Fuller Unit Roots Test (NONE), Series " + %l(i)) i sambeg samend
report(row=new,atcol=2) %l(i) %%cdstat
end dofor
report(action=show)