/*
  eivreg

*! VERSION 1.0.4  23aug2010

  keyword:  eclass

*/

VERSION 12.0

INCLUDE _std_large
INCLUDE header
HELP hlp1, view("help eivreg")
RESET res1

DIALOG main, label("eivreg - Errors-in-variables regression")/*
		*/ tabtitle("Model")
BEGIN
  /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+*/ 
  TEXT tx_dv 		_lft	_top	_vnwd	.,			///
	label("Dependent variable:")
  VARNAME vn_dv		@ 	_ss	@	.,			///
	label("Dependent variable")

  TEXT tx_iv		_vlx	_top	160	.,			///
	label("Independent variables:")
  VARLIST vl_iv		@	_ss	_vlwd	.,			///
	fv 								///
	allowcat							///
	label("Independent variables")
  TEXT     tx_reliab _lft      _ls       _iwd      .,			/*
*/ label("Measurement reliabilities for independent variables: (e.g., ivar1 0.8 ivar2 0.9)") /*
		*/
  VARLIST  vn_reliab @         _ss       @         .,			/*
	*/ label("Measurement reliabilities for independent variables")	/*
		*/ option("reliab")					/*
		*/
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 20
  INCLUDE _sp_level

  DEFINE _x _lft
  DEFINE _y _ls
  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 "eivreg "
	varlist main.vn_dv [main.vl_iv]
	INCLUDE _weights_pr
	INCLUDE _ifin_pr
	beginoptions
		require main.vn_reliab
		optionarg main.vn_reliab
		optionarg /hidedefault rpt.sp_level
		INCLUDE _noomitted_pr
		INCLUDE _vsquish_pr
		INCLUDE _factor_vars_reporting_pr
		put " " rpt_bu_fmtcoefResults
	endoptions
END

