Autolagselect for series
Autolagselect for series
Dear Tom,
I have a quesiton about how to display the AIC optimal lags for each series in a table. I have written the code:
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(det=NONE, crit=AIC, maxlag=6, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i), print) i sambeg samend
compute Lagselect = %%LAGS
dis 'Lags:' %l(i) 'Lagselect = ' %%LAGS
end dofor
But then need to create a table where I have series in one column and optimal lags numbers in another column. Somehow I cannot find the syntax to use it.
Thank you very much.
I have a quesiton about how to display the AIC optimal lags for each series in a table. I have written the code:
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(det=NONE, crit=AIC, maxlag=6, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i), print) i sambeg samend
compute Lagselect = %%LAGS
dis 'Lags:' %l(i) 'Lagselect = ' %%LAGS
end dofor
But then need to create a table where I have series in one column and optimal lags numbers in another column. Somehow I cannot find the syntax to use it.
Thank you very much.
Re: Autolagselect for series
Use REPORT, as in:
Code: Select all
report(action=define,title="Selected Lag Lengths")
report(atrow=1,atcol=1) "Variable" "Lags"
dofor i = DEPENDENT RGDP UR CPI TR3M TR10Y CRE HPI OIL BAA SP500
@ADFAutoSelect(det=NONE, crit=AIC, maxlag=6, TITLE="Dickey-Fuller Unit Root Test (NONE):" + %l(i), print) i sambeg samend
report(row=new,atcol=1) %l(i) %%lags
end dofor
report(action=show)
Re: Autolagselect for series
Oh, it works! Fantastic! Thank you SO much, Tom!