/*
  mvreg

*! VERSION 1.0.5  23aug2010

  keyword:  eclass

*/

VERSION 12.0

INCLUDE _std_large
DEFINE _dlght 320
INCLUDE header

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

SCRIPT PREINIT
BEGIN
	program parseMessage
END

PROGRAM parseMessage
BEGIN
	if __MESSAGE.contains("__MI__") {
		call script byifin_set_by_off
	}
END

DIALOG main, label("mvreg - Multivariate regression") tabtitle("Model")
BEGIN
  /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+*/ 
  TEXT     tx_dv     _lft      _top      _iwd      .,			/*
		*/ label("Dependent variables:")			/*
		*/
  VARLIST  vl_dv     @         _ss       @         .,			/*
		*/ label("Dependent variables") ts			/*
		*/

  TEXT     tx_iv     @         _ls       @         .,			/*
		*/ label("Independent variables:")			/*
		*/
  VARLIST  vl_iv     @         _ss       @         .,			/*
		*/ label("Independent variables") ts fv			/*
		*/ allowcat						/*
		*/
  CHECKBOX ck_nocons @         _ms       _cwd1     .,			/*
		*/ label("Suppress constant term")			/*
		*/ option("noconstant")					/*
		*/


/* -noheader- and -notable- are programmers options */
END

INCLUDE byifin
INCLUDE weights_fa

SCRIPT rpt_POSTINIT
BEGIN
	create STRING rpt_bu_fmtcoefResults
	program rpt_bu_fmtcoef_ckResults
END

DIALOG rpt, tabtitle("Reporting")
BEGIN	
  DEFINE _x _lft
  DEFINE _cx _spr
  DEFINE _y _top
  INCLUDE _sp_level
  
  CHECKBOX ck_corr   _lft      _ls       _cwd1     .,			/*
		*/ label("Report correlation matrix")			/*
		*/ option("corr")					/*
		*/

  DEFINE _x _lft
  DEFINE _y _ms
  DEFINE _cx _iwd
  INCLUDE _noomitted

  DEFINE _x _lft
  DEFINE _y _ms
  DEFINE _cx _iwd
  INCLUDE _vsquish

  DEFINE _x _lft
  DEFINE _y _ms
  DEFINE _cx _iwd
  INCLUDE _factor_vars_reporting

  DEFINE _x _lft
  DEFINE _y _xxxls
  INCLUDE _bu_coef_table_reporting
END

INCLUDE fmt_coef_table_reporting_pr

PROGRAM command
BEGIN
	INCLUDE _by_pr
	put "mvreg "
	varlist main.vl_dv 
	put "="
	varlist main.vl_iv
	INCLUDE _weights_pr
	INCLUDE _ifin_pr
	beginoptions
		option main.ck_nocons
		optionarg /hidedefault rpt.sp_level
		INCLUDE _noomitted_pr
		INCLUDE _vsquish_pr
		INCLUDE _factor_vars_reporting_pr
		option rpt.ck_corr
		put " " rpt_bu_fmtcoefResults
	endoptions
END

