%% Assess Stationarity Using the Phillips-Perron Test
% Test GDP data for a unit root using a trend-stationary alternative with 0, 1, and 2 lags for the Newey-West estimator.
% Load the GDP data set.

load Data_GDP
logGDP = log(Data);

%
% Perform the Phillips-Perron test including 0, 1, and 2 autocovariance lags in the Newey-West robust covariance estimator.

h = pptest(logGDP,'model','TS','lags',0:2)

% Each test returns h = 0, which means the test fails to reject the unit-root null hypothesis for each set of lags. Therefore, there is not enough evidence to suggest that log GDP is trend stationary.
% Copyright 2015 The MathWorks, Inc.