Usage: ADFGLSTest(Y,trend,maxlag,down,crit,pq) ADFGLSTest(Y) Parameters: Y (series: series to test) trend (bool: include a trend) default is no (trend = 0) maxlag (int: Lag order for the ADF-GLS test) default is -1, in that case round((12*$nobs/100)^0.25) is used downward (bool: test down from maximum lag order) default is yes (downward = 1) crit (int: criterion) options: MAIC (default, crit =1) and MBIC (crit =0) pq (bool: use Perron-Qu method) default is no (pq = 0) The function is a wrapper to gretl's "adf" command, but it adds additional output to it. It computes p-values using MacKinnon's(1994) full-blown (modified) approach based on our own simulations of sample quantiles. Output is a matrix containing the test statistic and associated p-value. References: MacKinnon, J. G. 1994. Approximate asymptotic distribution functions for unit-root and cointegration tests. Journal of Business and Economic Statistics 12: 167–176. Background information: http://gretl.sourceforge.net/papers/adfgls-komashko.pdf Changelog: 0.1 - November 2020: make internal syntax compatible with stricter rules of gretl 2020e 0.055 - 2015: first known release