/*
  lroc

*!  VERSION 2.1.1  07mar2011

*/

VERSION 12.0

INCLUDE _std_xwide
DEFINE _dlght 300
INCLUDE header

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

SCRIPT PREINIT
BEGIN
	gr_line_options.settabtitle "Reference line"
END

SCRIPT POSTINIT
BEGIN
	script gr_plots_setDefaultConnected
	gr_line_options_optionName.setstring "rlopts"
END

DIALOG main, tabtitle("Main")	///
	label("lroc - Compute area under ROC curve and graph the curve")

BEGIN
  GROUPBOX gb_test		_lft	_top	400	_ht4,	///
	label("ROC curve")

  RADIO    rb_estimate		_ilft	_ss	_inwd	.,	///
	first 							///
	onclickon(script ifin_enable)				///
	label("Compute area and graph curve for estimation sample")
  RADIO    rb_obs		@	_ss	@	@,	///
	last							///
	onclickon(script ifin_disable)				///
	option(all)						///
	label("Compute area and graph curve for all observations")

  CHECKBOX ck_nograph		_lft	+45	400	.,	///
	label("Suppress graph")					///
	onclickoff(script graph_on)				///
	onclickon(script graph_off)				///
	option(nograph)
END

SCRIPT graph_on
BEGIN
	/* turn on all the graphs tabs */
	script gr_plots_enable
	script gr_line_options_enable
	script gr_addplots_enable
	script gr_yaxis_enable
	script gr_xaxis_enable
	script gr_titles_enable
	script gr_legend_enable
	script gr_overall_enable
END

SCRIPT graph_off
BEGIN
	/* turn off all the graphs tabs */
	script gr_plots_disable
	script gr_line_options_disable
	script gr_addplots_disable
	script gr_yaxis_disable
	script gr_xaxis_disable
	script gr_titles_disable
	script gr_legend_disable
	script gr_overall_disable
END

INCLUDE ifin
INCLUDE weights_f

INCLUDE _beta_adv

INCLUDE gr_plots
INCLUDE gr_line_options
INCLUDE gr_addplots
INCLUDE gr_yaxis
INCLUDE gr_xaxis
INCLUDE gr_titles
INCLUDE gr_legend
INCLUDE gr_overall

PROGRAM command
BEGIN
	put "lroc "
	put " " /program _beta_adv_depvar_output
	put " " /program weights_output
	put " " /program ifin_output
	beginoptions
		option main.ck_nograph
		option main.rb_obs
		put " " /program _beta_adv_lbbeta_output

		if !main.ck_nograph {
			put " " /program gr_plots_output
			put " " /program gr_line_options_output
			put " " /program gr_addplots_output
			put " " /program gr_yaxis_output
			put " " /program gr_xaxis_output
			put " " /program gr_titles_output
			put " " /program gr_legend_output
			put " " /program gr_overall_output
		}
	endoptions
END
