/*
	predict (after stcrreg)

*!  VERSION 1.0.1  10jun2009

*/

VERSION 11.0

INCLUDE _std_mlarge
INCLUDE _ht330
INCLUDE header

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

SCRIPT POSTINIT
BEGIN
	script _p_gentype_setMedium
END

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

  GROUPBOX gb_opts	_lft	_ls	_iwd	_ht20,			///
	label("Produce:")
  RADIO rb_shr		_indent	_ss	_inwd	., first		///
	option(shr)							///
	onclickon(script main_scores_off_nooffset_on)			///
	label("Subhazard ratio (relative subhazard)")
  DEFINE y @y
  RADIO rb_xb		@	_ss	@	.,			///
	option(xb)							///
	onclickon(script main_scores_off_nooffset_on)			///
	label("Linear prediction")
  RADIO rb_stdp		@	_ss	@	.,			///
	option(stdp)							///
	onclickon(script main_scores_off_nooffset_on)			///
	label("Standard error of the linear prediction")
  RADIO rb_basecif	@	_ss	@	.,			///
	option(basecif)							///
	onclickon(script main_all_off)					///
	label("Baseline cummulative incidence function")
  RADIO rb_basecshazard	@	_ss	@	.,			///
	option(basecshazard)						///
	onclickon(script main_all_off)					///
	label("Baseline cummulative subhazard function")
  RADIO rb_kmcensor	@	_ss	@	.,			///
	option(kmcensor)						///
	onclickon(script main_all_off)					///
	label("Kaplan-Meier survivor curve for censoring distribution")
  RADIO rb_scores	@	_ss	@	.,			///
	option(scores)							///
	onclickon(script main_scores_on_partial_on)			///
	label("Pseudolikelihood scores")
  RADIO	rb_esr		@	_ss	@	.,			///
	option(esr)							///
	onclickon(script main_scores_on_partial_on)			///
	label("Efficient score residuals")
  RADIO	rb_dfbeta	@	_ss	@	.,			///
	option(dfbeta)							///
	onclickon(script main_scores_on_partial_on)			///
	label("DFBETA measures of influence")
  RADIO	rb_schoenfeld	@	_ss	@	., last			///
	option(schoenfeld)						///
	onclickon(script main_scores_on)				///
	label("Schoenfeld residuals")
  CHECKBOX ck_nooffset	_lft	_xls	_cwd1	.,			///
	option(nooffset)						///
	label("Ignore offset variable (if any)")
  CHECKBOX ck_partial	_lft2	@	@	.,			///
	option(partial)							///
	label("Observation-level results")
END

INCLUDE _p_gentype_sc
INCLUDE ifin
INCLUDE _type_list_fd

SCRIPT main_scores_off_nooffset_on
BEGIN
	script _p_gentype_single
	main.ck_nooffset.enable
	main.ck_partial.disable
END

SCRIPT main_all_off
BEGIN
	script _p_gentype_single
	main.ck_nooffset.disable
	main.ck_partial.disable
END

SCRIPT main_scores_on_partial_on
BEGIN
	script _p_gentype_scores_on
	main.ck_nooffset.disable
	main.ck_partial.enable
END

SCRIPT main_scores_on
BEGIN
	script _p_gentype_scores_on
	main.ck_nooffset.disable
	main.ck_partial.disable
END

PROGRAM command
BEGIN
	put "predict "
	put " " /program _p_gentype_output
	INCLUDE _ifin_pr
	beginoptions
		option radio(main rb_shr rb_xb rb_stdp rb_basecif	///
			rb_basecshazard rb_kmcensor rb_scores rb_esr 	///
			rb_dfbeta rb_schoenfeld)
		option main.ck_partial
	endoptions
	INCLUDE _p_nooffset_pr
END
