/*
	predict (after nl)

*!  VERSION 1.2.0  23apr2007

*/

VERSION 9.0

INCLUDE _std_medium
INCLUDE header

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

SCRIPT POSTINIT
BEGIN
	script _p_gentype_setMedium
END

DEFINE awid   45
DEFINE asep  +50
DEFINE bwid   40
DEFINE bsep  +45
DEFINE uwid  110
DEFINE usep +115
DEFINE vwid   55
DEFINE vsep  +60

DIALOG main, label("predict - Prediction after estimation") tabtitle("Main")
BEGIN
  INCLUDE  _p_gentype

  GROUPBOX gb_opts           _lft      _ls       _iwd      _ht14,	/*
		*/ label("Produce:")
  RADIO    rb_yhat           _indent   _ss       _inwd     ., first	/*
		*/ option(yhat)						/*
		*/ label("Fitted values")				/*
		*/ onclickon(script all_off)
  RADIO    rb_residuals      @         _ss       @         ., 		/*
		*/ option(residuals)					/*
		*/ label("Residuals")					/*
		*/ onclickon(script all_off)

  RADIO    rb_pr        _ilft      _ms     awid        .,	/*
		*/ option(NONE)  /* handled another way */	/*
		*/ clickon("script pr_on")			/*
		*/ label("Pr(y|")
  EDIT     en_pr_a       asep        @   _en7wd        .,	/*
		*/ numonly					/*
		*/ label("Pr() lower limit")
  TEXT     tx_pr      _en7sep        @     bwid        .,	/*
		*/ center label("< y <")
  EDIT     en_pr_b       bsep        @   _en7wd        .,	/*
		*/ numonly					/*
		*/ label("Pr() upper limit")
  TEXT     tx_pr2     _en7sep        @     bwid        ., label(")")

  RADIO    rb_e         _ilft      _ms     awid        .,	/*
		*/ option(NONE)  /* handled another way */	/*
		*/ clickon("script e_on")			/*
		*/ label("E(y|")
  EDIT     en_e_a        asep        @   _en7wd        .,	/*
		*/ numonly					/*
		*/ label("E() lower limit")
  TEXT     tx_e       _en7sep        @     bwid        .,	/*
		*/ center label("< y <")
  EDIT     en_e_b        bsep        @   _en7wd        .,	/*
		*/ numonly					/*
		*/ label("E() upper limit")
  TEXT     tx_e2      _en7sep        @     bwid        ., label(")")

  RADIO    rb_ystar     _ilft      _ms     uwid        .,	/*
		*/ option(NONE)  /* handled another way */	/*
		*/ clickon("script ystar_on")			/*
		*/ label("E(y*), y* = max(")
  EDIT     en_ystar_a    usep        @   _en7wd        .,	/*
		*/ numonly					/*
		*/ label("E(y*) lower limit")
  TEXT     tx_ystar   _en7sep        @     vwid        .,	/*
		*/ center label(", min(y,")
  EDIT     en_ystar_b    vsep        @   _en7wd        .,	/*
		*/ numonly					/*
		*/ label("E(y*) upper limit")
  TEXT     tx_ystar2  _en7sep        @     bwid        ., label("))")
  RADIO    rb_score          _ilft     _ms       _comb3_2  ., 		/*
		*/ option(scores)					/*
		*/ onclickon(script scores_on)				/*
		*/ label("Scores")					/*
		*/ last
END


SCRIPT all_off
BEGIN
	script pr_off
	script e_off
	script ystar_off
	script _p_gentype_single
END

SCRIPT scores_on
BEGIN
	script pr_off
	script e_off
	script ystar_off
	script _p_gentype_multiple
END

SCRIPT pr_on
BEGIN
	script e_off
	script ystar_off
	script _p_gentype_single
	main.en_pr_a.enable
	main.en_pr_b.enable
END

SCRIPT pr_off
BEGIN
	main.en_pr_a.disable
	main.en_pr_b.disable
END

SCRIPT e_on
BEGIN
	script pr_off
	script ystar_off
	script _p_gentype_single
	main.en_e_a.enable
	main.en_e_b.enable
END

SCRIPT e_off
BEGIN
	main.en_e_a.disable
	main.en_e_b.disable
END

SCRIPT ystar_on
BEGIN
	script pr_off
	script e_off
	script _p_gentype_single
	main.en_ystar_a.enable
	main.en_ystar_b.enable
END

SCRIPT ystar_off
BEGIN
	main.en_ystar_a.disable
	main.en_ystar_b.disable
END

INCLUDE _p_gentype_sc
INCLUDE ifin
INCLUDE _type_list_fd

PROGRAM command
BEGIN
	put "predict "
	put " " /program _p_gentype_output
	INCLUDE _ifin_pr
	beginoptions
		option radio(main rb_yhat rb_residuals rb_score)
	endoptions
	INCLUDE _pr_pr
	INCLUDE _e_pr
	INCLUDE _ystar_pr
END
