/*
	expoisson_estat

*!  VERSION 1.0.0  12apr2007

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

VERSION 10.0

INCLUDE _std_large
DEFINE _dlght 360	//dialog length for bootstrap options
INCLUDE header

HELP hlp1, view("help expoisson postestimation")
RESET res1

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

  DEFINE holdy 110

  // se option
  GROUPBOX gb_coefopt	_lft	holdy	_iwd	_ht4,		///
  	label("Coefficient options")

  RADIO    rb_coef	_indent	_ss	_ibwd	., 		///
	first							///
	label("Report coefficients (default)") 			///
	option(NONE)
  RADIO    rb_irr	@	_ss	@	.,		///
	last							///
	label("Report incidence-rate ratios")			///
	option(irr)

  // Summarize options
  GROUPBOX gb_eqlist            _lft    holdy	_iwd	_ht6,		///
  	label("Summarize")
  RADIO    rb_default		_ilft	_ss	_inwd	.,		///
  	first label("Use all variables involved in the estimation")	///
  	onclickon(main.vl_spec.disable)
  RADIO    rb_spec		@	_ss	@	.,		///
	onclickon(main.vl_spec.enable) last				///
	label("Use variables and optional equation names:")
  VARLIST  vl_spec	      _indent2	_ss	_inwd	.,		///
	label("Use variables and optional equation names")
  CHECKBOX ck_equation      	_lft	+45	_iwd	.,		///
	option(equation)						///
	label("Display summary by equation")
  CHECKBOX ck_labels		@	_ms	@	.,		///
  	label("Display variable labels")				///
  	option(labels)
  CHECKBOX ck_noheader		_lft	_ms	_iwd	.,		///
	option(noheader)						///
	label("Suppress the header")
  CHECKBOX ck_noweights		@	_ms	@	.,		///
	option(noweights)						///
	label("Ignore weights")
END

LIST main_subcommand_contents
BEGIN
	"Report coefficient asymptotic standard errors (se)"
	"Summarize estimation sample (summarize)"
END

LIST main_subcommand_values
BEGIN
	se
	summarize
END

LIST main_subcommand_scripts
BEGIN
	script sel_se
	script sel_summarize
END

SCRIPT sel_se
BEGIN
	script main_hide_all
	script main_se_on
END

SCRIPT sel_summarize
BEGIN
	script main_hide_all
	script main_summ_on
END

SCRIPT main_se_on
BEGIN
	main.gb_coefopt.show
	main.rb_coef.show
	main.rb_irr.show
END

SCRIPT main_se_off
BEGIN
	main.gb_coefopt.hide
	main.rb_coef.hide
	main.rb_irr.hide
END

SCRIPT main_summ_on
BEGIN
	main.ck_equation.show
	main.ck_labels.show
	main.ck_noheader.show
	main.ck_noweights.show
	main.gb_eqlist.show
	main.rb_default.show
	main.rb_spec.show
	main.vl_spec.show
END

SCRIPT main_summ_off
BEGIN
	main.ck_equation.hide
	main.ck_labels.hide
	main.ck_noheader.hide
	main.ck_noweights.hide
	main.gb_eqlist.hide
	main.rb_default.hide
	main.rb_spec.hide
	main.vl_spec.hide
END

SCRIPT main_hide_all
BEGIN
	script main_summ_off
	script main_se_off
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
	if main.rb_spec {
		require main.vl_spec
		put " " main.vl_spec
	}
	beginoptions
		// se option
		option main.rb_irr

		// Summarize options
		option main.ck_equation
		option main.ck_labels
		option main.ck_noheader
		option main.ck_noweights
	endoptions
END
