%% Return Test Results Without Display
% Conduct paired integration and stationarity tests on two time series and their differences. Turn the results display off, and return the test decisions and p-values.
% Load the Nelson-Plosser data, and extract the series of real GNP, GNPR, and consumer price index, CPI.

load Data_NelsonPlosser		
X = DataTable(:,{'GNPR','CPI'});

% X is a tabular array containing the variables GNPR and CPI.
%
% Set the integration and stationarity test parameters.

I.names = {'lags','model'};
I.vals = {1,'TS'};

S.names = {'trend'};
S.vals = {true};

%
% Conduct the integration and stationarity tests on the variables and their first differences, specified using numDiffs.

[H,PValue] = i10test(X,'numDiffs',1,'itest','adf',...
                     'iparams',I,'stest','kpss',...
                     'sparams',S,'display','off')

% The warnings indicate that the p-values are very large or small for some of the tests (that is, they are outside the Monte Carlo simulated tables). The test decisions and p-values are stored in H and PValue, respectively.
% For each original series, a unit root is not rejected (H = 0), and stationarity is rejected (H = 1), as indicated in the first and third rows of the output H. For each differenced series, a unit root is rejected (H = 1), and stationarity is not rejected (H = 0), as indicated in the second and fourth rows of the output H.
% At the given parameter settings, the tests suggest that both series have one degree of integration.
% Copyright 2015 The MathWorks, Inc.