/*
	pperron2

	VERSION 1.0.0  21dec2002
*/

VERSION 8.0

INCLUDE _std_large
INCLUDE _ht230
INCLUDE header

HELP hlp1, view("help pperron")
RESET res1

DIALOG main, label("pperron - Phillips-Perron unit root test for panel data") /*
                */ tabtitle("Main")
BEGIN
        DEFINE _x _xsetbu
	DEFINE _y _top
	INCLUDE _bu_tsset
	TEXT    tx_var	        _lft   	_top    _cwd2   .,   	        /*
                */      label("Variable:")
	VARNAME vn_var          @      	_ss     _vnwd   .,            	/*
                */      label("Variable")                              	/*
                */      allowts
	CHECKBOX ck_noconstant  @	_ls     _iwd    .,		/*
		*/	label("Exclude constant from regression")	/*
		*/	clickon("gaction main.ck_trend.disable")	/*
		*/	clickoff("gaction main.ck_trend.enable")	/*
		*/	option(noconstant)
	CHECKBOX ck_trend       @ 	_ms	@       .,		/*
		*/	label("Include trend term in regression")	/*
		*/ 	option(trend)
        CHECKBOX ck_regress     @      	_ms     @       .,             	/*
                */      label("Display regression table")		/*
		*/	option(regress)
	GROUPBOX gb_lag	        @      	_ls     @       _ht4h,		/*
		*/	label("Lags")
	RADIO    rb_deflag      _indent	_ss	_inwd	., first	/*
		*/	label("Default lags -- (int(4*(N/100)^(2/9)))")	/*
		*/	clickon("gaction main.sp_lags.disable")		/*
		*/	clickoff("gaction main.sp_lags.enable")		
	RADIO 	 rb_lags        @	_ms	_rbwd	., last		/*
		*/	label("")					
		
        SPINNER	 sp_lags        _rbsep  @       _spwd   .,             	/*
		*/	min(0) max(10000)				/*
                */      label("Number of lags") 			/*
		*/	default(1)					/*
		*/	option(lags)
        TEXT     tx_lags        _spsep  @       _rbsprb .,		/*
		*/	label("Number of lags")				/*
		*/
END

INCLUDE ifin

PROGRAM command
BEGIN
	put "pperron2 "
	varlist main.vn_var
	INCLUDE _ifin_pr 
	beginoptions
		if main.rb_lags{
			optionarg main.sp_lags
		}
		option main.ck_noconstant
		option main.ck_trend
		option main.ck_regress
	endoptions
END