/*
	estat.idlg

*!  VERSION 1.0.1  23jun2009

	***
	USE EXTREME CARE WHEN CHANGING CONTROL NAMES. The names used
	in this file have multiple external dependencies.
*/


DIALOG main, label("estat - Postestimation statistics") tabtitle("Main")
BEGIN
  TEXT     tx_subcmd		_lft	_top	300	.,		///
  	label("Reports and statistics: (subcommand)")
  LISTBOX  lb_subcmd		@	_ss	@	55,		///
  	contents(main_subcommand_contents)				///
  	values(main_subcommand_values)					///
  	onselchangelist(main_subcommand_scripts)

  DEFINE holdy 95
  // Information criteria
  CHECKBOX ck_n			_lft	holdy	_iwd	.,		///
	onclickon(main.sp_n.enable)					///
	onclickoff(main.sp_n.disable)					///
	label("Number of observations for calculating BIC")
  SPINNER sp_n			_indent2 _ss	_spwd	.,		///
	default(e(N)) min(1) max(e(N))					///
	option(n)


  INCLUDE estat_sum
  INCLUDE estat_vce
  INCLUDE _estat_bootstrap
END

INCLUDE estat_sum_pr
INCLUDE estat_vce_pr
INCLUDE _estat_bootstrap_pr

LIST main_subcommand_contents
BEGIN
 	 "Information criteria (ic)"
 	 "Summarize estimation sample (summarize)"
 	 "Covariance matrix estimates (vce)"
END

LIST main_subcommand_values
BEGIN
	ic
	summarize
	vce
END

LIST main_subcommand_scripts
BEGIN
	script sel_ic
	script sel_summarize
	script sel_vce
END

SCRIPT sel_ic
BEGIN
	script main_hide_all
	main.ck_n.show
	main.sp_n.show
END

SCRIPT sel_summarize
BEGIN
	script main_hide_all
	program main_summ_on
END

SCRIPT sel_vce
BEGIN
	script main_hide_all
	program vce_on
END

SCRIPT main_hide_all  // MUST BE IMPLEMENTED FOR BOOTSTRAP
BEGIN
	main.ck_n.hide
	main.sp_n.hide
	program vce_off
	script main_summ_off
	script main_bootstrap_hide
END

PROGRAM vl_output
BEGIN
	put main.vl_spec
END

PROGRAM vl_eq_output
BEGIN
	put main.vl_eq
END

PROGRAM command
BEGIN
	put "estat "
	put main.lb_subcmd
	put " " /program summarize_output
	beginoptions
		// ic options
		optionarg main.sp_n
		put " " /program summarize_opts_output
		put " " /program vce_output
		put " " /program bootstrap_output
	endoptions
END
