Dear community,
I would like to perform the KPSS unit root test in EViews 10 (University ed.) on a group of monthly series and store the test results (critical value > test statistic?) in a table. So far, my code reads:
Code: Select all
'Create a blank output table to store test results for the seasonally adjusted series contained in the group "monthly_x13"
table (5,monthly_x13.@count+1) KPSS_MONTHLY
setcell(KPSS_MONTHLY, 1, 1, "Test / Series", "l")
setcell(KPSS_MONTHLY, 2, 1, "KPSS (level, trend)", "l")
setcell(KPSS_MONTHLY, 3, 1, "KPSS (level, constant)", "l")
setcell(KPSS_MONTHLY, 4, 1, "KPSS (fd, trend)", "l")
setcell(KPSS_MONTHLY, 5, 1, "KPSS (fd, constant)", "l")
'Loop through all series in the group "monthly_x13"
for !i=1 to monthly_x13.@count
'Enforce the correct series names
%name = monthly_x13.@seriesname(!i)
'Obtain and store kpss test results (p-values)
uroot(kpss, trend, dif=0, save=kpss1) {%name} 'for levels, assuming an intercept and exogenous trend
KPSS_MONTHLY(1,1+!i)=%name
KPSS_MONTHLY(2, 1+!i)= kpss1(5,1)-kpss1(3,1)
uroot(kpss, const, dif=0, save=kpss2) {%name} 'for levels, assuming an intercept
KPSS_MONTHLY(3, 1+!i)= kpss2(5,1)-kpss2(3,1)
uroot(kpss, trend, dif=1, save=kpss3) {%name} 'for first difference, assuming an intercept and exogenous trend
KPSS_MONTHLY(4, 1+!i)= kpss3(5,1)-kpss3(3,1)
uroot(kpss, const, dif=1, save=kpss4) {%name} 'for first difference, assuming an intercept
KPSS_MONTHLY(5, 1+!i)= kpss4(5,1)-kpss4(3,1)
next
However, the output table gives me only 'NA' values. This is due to the fact that the matrices kpss1 to kpss5 contain only 'NA' values where the critical values should be. Somehow my routine does not properly extract the critical values.
Could you please tell me how to access the individual critical values of the kpss test?
Thank you in advance!