Create a table with unit root tests and p-values
Posted: Thu Jun 19, 2014 10:21 am
Hi,
I would like to create a table that calculates the unit root and associated p-values for a group of time series. I have used some code from other posts but can't quite get the result I'm looking for. My table will include unit root tests both with and without a trend for comparison purposes and I would like to have the p-values in the columns next to the respective unit root tests (i.e. column 1 will have unit root w/o trend, column 2 will have the associated p-value, column 3 will have the unit root test w/trend and column 4 will have the associated p-value). Finally, I would like to have column headers that explain what each column contains. Here is the associated code I have used so far, which is able to calculate the unit roots without and then with trend:
'select a group
group unit_root
'create a table
table ADF
for !i = 1 to unit_root.@count
%U1 = unit_root.@seriesname(!i)
uroot(adf,const,dif=0,info=sic, save=level1) {%U1}
ADF(1+!i,1) = %u1
ADF(1 +!i,2) = level1(3,1)
uroot(adf,trend, dif=0, save=level2) {%U1}
ADF(1+!i,3) = level2(3,1)
next
Thanks for the help!
I would like to create a table that calculates the unit root and associated p-values for a group of time series. I have used some code from other posts but can't quite get the result I'm looking for. My table will include unit root tests both with and without a trend for comparison purposes and I would like to have the p-values in the columns next to the respective unit root tests (i.e. column 1 will have unit root w/o trend, column 2 will have the associated p-value, column 3 will have the unit root test w/trend and column 4 will have the associated p-value). Finally, I would like to have column headers that explain what each column contains. Here is the associated code I have used so far, which is able to calculate the unit roots without and then with trend:
'select a group
group unit_root
'create a table
table ADF
for !i = 1 to unit_root.@count
%U1 = unit_root.@seriesname(!i)
uroot(adf,const,dif=0,info=sic, save=level1) {%U1}
ADF(1+!i,1) = %u1
ADF(1 +!i,2) = level1(3,1)
uroot(adf,trend, dif=0, save=level2) {%U1}
ADF(1+!i,3) = level2(3,1)
next
Thanks for the help!