⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 irf_ctable.dlg

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 DLG
字号:
/*
  irf ctable

*!  VERSION 1.1.2  20may2005

*/

VERSION 9.0
SYNCHRONOUS_ONLY

INCLUDE _std_graph
INCLUDE header

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

DIALOG main, tabtitle("Main") ///
label("irf ctable - Combine tables of impulse-response functions and FEVDs")
BEGIN
  // set IRF active file
  DEFINE _x _xsetbu
  DEFINE _y _top
  INCLUDE _bu_irfset

DEFINE varwd 105
DEFINE varsep +110
DEFINE statwd 335
DEFINE statsep +340

  // column 0
  TEXT     tx_irf	45        _ms       varwd     .,		///
		label("IRF result set:")
  DEFINE x1 @x						// column 1
  TEXT     tx_imp	varsep    @         @         .,		///
		label("Impulse:")
  DEFINE x2 @x						// column 2
  TEXT     tx_res	varsep    @         @         .,		///
		label("Response:")
  DEFINE x3 @x						// column 3
  TEXT     tx_stats	varsep    @         statwd    .,		///
		label("Statistic:")
  DEFINE x4 @x						// column 4
  TEXT     tx_ci	statsep   @         _ckwd     .,		///
		label("CI")
  DEFINE x5 @x						// column 5
  TEXT     tx_se	_cksep    @         @         .,		///
		label("SE")
  DEFINE x6 @x						// column 6

//---
  TEXT     tx_spec1	     _lft      _ms       13        .,		///
		label("1:")
  CHECKBOX ck_spec1	     +15       @         _ckwd     .,		///
		onclickon(script irf_spec1_on)				///
		onclickoff(script irf_spec1_off)

  COMBOBOX cb_irf1	     x1        @         varwd     .,		///
		label("IRF result set")	error("IRF result set 1") 	///
		dropdownlist						///
		contents(irf_list1) onselchange(program main_update_vars1)
  COMBOBOX cb_imp1	     x2        @         @         .,		///
		label("Impulse") error("Impulse 1")			///
		contents(impulse_list1) dropdown
  COMBOBOX cb_res1	     x3        @         @         .,		///
		label("Response") error("Response 1")			///
		contents(response_list1) dropdown
  COMBOBOX cb_stats1	     x4        @         statwd    .,		///
		dropdown						///
		append							///
		contents(irf_stat_contents)				///
		values(irf_stat_values)					///
		label("Statistic")					///
		error("Statistic 1")
  CHECKBOX ck_ci1	     x5        @         _ckwd     .,		///
		option(ci) 						///
		onclickon(script main_ci1_on)				///
		onclickoff(script main_ci1_off)
  CHECKBOX ck_se1	     x6        @         @         .,		///
		option(stderror)
//--
//---
  TEXT     tx_spec2	     _lft      _ms       13        .,		///
		label("2:")
  CHECKBOX ck_spec2	     +15       @         _ckwd     .,		///
		onclickon(script irf_spec2_on)				///
		onclickoff(script irf_spec2_off)

  COMBOBOX cb_irf2	     x1        @         varwd     .,		///
		label("IRF result set")	error("IRF result set 2") 	///
		dropdownlist						///
		contents(irf_list2) onselchange(program main_update_vars2)
  COMBOBOX cb_imp2	     x2        @         @         .,		///
		label("Impulse") error("Impulse 2")			///
		contents(impulse_list2) dropdown
  COMBOBOX cb_res2	     x3        @         @         .,		///
		label("Response") error("Response 2")			///
		contents(response_list2) dropdown
  COMBOBOX cb_stats2	     x4        @         statwd    .,		///
		dropdown						///
		append							///
		contents(irf_stat_contents)				///
		values(irf_stat_values)					///
		label("Statistic")					///
		error("Statistic 2")
  CHECKBOX ck_ci2	     x5        @         _ckwd     .,		///
		option(ci) 						///
		onclickon(script main_ci2_on)				///
		onclickoff(script main_ci2_off)
  CHECKBOX ck_se2	     x6        @         @         .,		///
		option(stderror)
//--
//---
  TEXT     tx_spec3	     _lft      _ms       13        .,		///
		label("3:")
  CHECKBOX ck_spec3	     +15       @         _ckwd     .,		///
		onclickon(script irf_spec3_on)				///
		onclickoff(script irf_spec3_off)

  COMBOBOX cb_irf3	     x1        @         varwd     .,		///
		label("IRF result set")	error("IRF result set 3") 	///
		dropdownlist						///
		contents(irf_list3) onselchange(program main_update_vars3)
  COMBOBOX cb_imp3	     x2        @         @         .,		///
		label("Impulse") error("Impulse 3")			///
		contents(impulse_list3) dropdown
  COMBOBOX cb_res3	     x3        @         @         .,		///
		label("Response") error("Response 3")			///
		contents(response_list3) dropdown
  COMBOBOX cb_stats3	     x4        @         statwd    .,		///
		dropdown						///
		append							///
		contents(irf_stat_contents)				///
		values(irf_stat_values)					///
		label("Statistic")					///
		error("Statistic 3")
  CHECKBOX ck_ci3	     x5        @         _ckwd     .,		///
		option(ci) 						///
		onclickon(script main_ci3_on)				///
		onclickoff(script main_ci3_off)
  CHECKBOX ck_se3	     x6        @         @         .,		///
		option(stderror)
//--
//---
  TEXT     tx_spec4	     _lft      _ms       13        .,		///
		label("4:")
  CHECKBOX ck_spec4	     +15       @         _ckwd     .,		///
		onclickon(script irf_spec4_on)				///
		onclickoff(script irf_spec4_off)

  COMBOBOX cb_irf4	     x1        @         varwd     .,		///
		label("IRF result set")	error("IRF result set 4") 	///
		dropdownlist						///
		contents(irf_list4) onselchange(program main_update_vars4)
  COMBOBOX cb_imp4	     x2        @         @         .,		///
		label("Impulse") error("Impulse 4")			///
		contents(impulse_list4) dropdown
  COMBOBOX cb_res4	     x3        @         @         .,		///
		label("Response") error("Response 4")			///
		contents(response_list4) dropdown
  COMBOBOX cb_stats4	     x4        @         statwd    .,		///
		dropdown						///
		append							///
		contents(irf_stat_contents)				///
		values(irf_stat_values)					///
		label("Statistic")					///
		error("Statistic 4")
  CHECKBOX ck_ci4	     x5        @         _ckwd     .,		///
		option(ci) 						///
		onclickon(script main_ci4_on)				///
		onclickoff(script main_ci4_off)
  CHECKBOX ck_se4	     x6        @         @         .,		///
		option(stderror)
//--
//---
  TEXT     tx_spec5	     _lft      _ms       13        .,		///
		label("5:")
  CHECKBOX ck_spec5	     +15       @         _ckwd     .,		///
		onclickon(script irf_spec5_on)				///
		onclickoff(script irf_spec5_off)

  COMBOBOX cb_irf5	     x1        @         varwd     .,		///
		label("IRF result set")	error("IRF result set 5") 	///
		dropdownlist						///
		contents(irf_list5) onselchange(program main_update_vars5)
  COMBOBOX cb_imp5	     x2        @         @         .,		///
		label("Impulse") error("Impulse 5")			///
		contents(impulse_list5) dropdown
  COMBOBOX cb_res5	     x3        @         @         .,		///
		label("Response") error("Response 5")			///
		contents(response_list5) dropdown
  COMBOBOX cb_stats5	     x4        @         statwd    .,		///
		dropdown						///
		append							///
		contents(irf_stat_contents)				///
		values(irf_stat_values)					///
		label("Statistic")					///
		error("Statistic 5")
  CHECKBOX ck_ci5	     x5        @         _ckwd     .,		///
		option(ci) 						///
		onclickon(script main_ci5_on)				///
		onclickoff(script main_ci5_off)
  CHECKBOX ck_se5	     x6        @         @         .,		///
		option(stderror)
//--
//---
  TEXT     tx_spec6	     _lft      _ms       13        .,		///
		label("6:")
  CHECKBOX ck_spec6	     +15       @         _ckwd     .,		///
		onclickon(script irf_spec6_on)				///
		onclickoff(script irf_spec6_off)

  COMBOBOX cb_irf6	     x1        @         varwd     .,		///
		label("IRF result set")	error("IRF result set 6") 	///
		dropdownlist						///
		contents(irf_list6) onselchange(program main_update_vars6)
  COMBOBOX cb_imp6	     x2        @         @         .,		///
		label("Impulse") error("Impulse 6")			///
		contents(impulse_list6) dropdown
  COMBOBOX cb_res6	     x3        @         @         .,		///
		label("Response") error("Response 6")			///
		contents(response_list6) dropdown
  COMBOBOX cb_stats6	     x4        @         statwd    .,		///
		dropdown						///
		append							///
		contents(irf_stat_contents)				///
		values(irf_stat_values)					///
		label("Statistic")					///
		error("Statistic 6")
  CHECKBOX ck_ci6	     x5        @         _ckwd     .,		///
		option(ci) 						///
		onclickon(script main_ci6_on)				///
		onclickoff(script main_ci6_off)
  CHECKBOX ck_se6	     x6        @         @         .,		///
		option(stderror)
//--

  FRAME    fr_note           _lft      +35       _cwd1     _ht5h,
DEFINE y @y
  TEXT     tx_note1          _indent   +10        _inwd     .,		///
  		label("Refresh IRF selections anytime the active IRF file is set or")
  TEXT     tx_note2          @         _vss      @         .,		///
  		label("changed, while this dialog is open.")

  BUTTON   bu_refresh        260       _ls       100       ., 		///
  		label("Refresh...") 					///
  		onpush(program main_get_irf)

  FRAME    fr_opts	     _lft2      y        _cwd1     _ht5h,
  CHECKBOX ck_indiv	     _indent    +10      _inwd     .,		///
		option(individual)					///
		label(`"Make an individual table for each combination"')
  TEXT     tx_title	     @         _ms       @         .,		///
		label("Overall table title:")
  EDIT     ed_title	     @         _ss       @         .,		///
		option(title)						///
		label("Overall table title")

  CHECKBOX ck_step	     _lft      +45      _ckwd     .,		///
		onclickon(program step_check)				///
		onclickoff(program step_check)

  SPINNER  sp_step	     _cksep    @         _spwd     .,		///
		min(1)							///
		max(500)						///
		default(1)						///
		option(step)						///
		label("Common maximum step")
  TEXT     tx_step	     _spsep    @         _ckspr2b  .,		///
		label("Common maximum step")
  DEFINE   _x _lft2
  DEFINE   _cx _spr2b
  DEFINE   _y @
  INCLUDE  _sp_level
END

SCRIPT main_PREINIT
BEGIN
	create BOOLEAN isGettingIRF
	create BOOLEAN isGettingIRFVars
	create BOOLEAN isLoading
	isLoading.settrue
END

SCRIPT main_POSTINIT
BEGIN
	isLoading.setfalse
END

SCRIPT POSTINIT
BEGIN
	program main_get_irf
END

PROGRAM main_get_irf
BEGIN
	put "_get_irf, "
	put "dialog(irf_ctable)
	put "busyflag(isGettingIRF) "
	put "control("
		put "main.cb_irf1 main.cb_irf2 main.cb_irf3 "
		put "main.cb_irf4 main.cb_irf5 main.cb_irf6"
	put ") "
	put "irfvalues("
		put /hidden main.cb_irf1 " "
		put /hidden main.cb_irf2 " "
		put /hidden main.cb_irf3 " "
		put /hidden main.cb_irf4 " "
		put /hidden main.cb_irf5 " "
		put /hidden main.cb_irf6 " "
	put ") "
	stata hidden

	call program main_update_vars1
	call program main_update_vars2
	call program main_update_vars3
	call program main_update_vars4
	call program main_update_vars5
	call program main_update_vars6

	if ! main.ck_spec1 & ! main.ck_spec2 & ! main.ck_spec3 		///
	   & ! main.ck_spec4 & ! main.ck_spec5 & ! main.ck_spec6 {
		if main.cb_irf1 {
			call main.ck_spec1.seton
		}
	}
END

PROGRAM main_update_vars1
BEGIN
	if ! isGettingIRF & ! isLoading & ! isGettingIRFVars {
		put "_set_irf_vars, "
		put "dialog(irf_ctable) "
		put "irfname("
			put /hidden main.cb_irf1
		put ") "
		put "impulsetarget(main.cb_imp1) "
		put "responsetarget(main.cb_res1) "
		put "impulsevalue(" main.cb_imp1 ") "
		put "responsevalue(" main.cb_res1 ") "
		put "list(main.cb_irf1) "
		put "busyflag(isGettingIRFVars)"
		stata hidden
	}
END

PROGRAM main_update_vars2
BEGIN
	if ! isGettingIRF & ! isLoading & ! isGettingIRFVars {
		put "_set_irf_vars, "
		put "dialog(irf_ctable) "
		put "irfname("
			put /hidden main.cb_irf2
		put ") "
		put "impulsetarget(main.cb_imp2) "
		put "responsetarget(main.cb_res2) "
		put "impulsevalue(" main.cb_imp2 ") "
		put "responsevalue(" main.cb_res2 ") "
		put "list(main.cb_irf2) "
		put "busyflag(isGettingIRFVars)"
		stata hidden
	}
END

PROGRAM main_update_vars3
BEGIN
	if ! isGettingIRF & ! isLoading & ! isGettingIRFVars {
		put "_set_irf_vars, "
		put "dialog(irf_ctable) "
		put "irfname("
			put /hidden main.cb_irf3
		put ") "
		put "impulsetarget(main.cb_imp3) "
		put "responsetarget(main.cb_res3) "
		put "impulsevalue(" main.cb_imp3 ") "
		put "responsevalue(" main.cb_res3 ") "
		put "list(main.cb_irf3) "
		put "busyflag(isGettingIRFVars)"
		stata hidden
	}
END

PROGRAM main_update_vars4
BEGIN
	if ! isGettingIRF & ! isLoading & ! isGettingIRFVars {
		put "_set_irf_vars, "
		put "dialog(irf_ctable) "
		put "irfname("
			put /hidden main.cb_irf4
		put ") "
		put "impulsetarget(main.cb_imp4) "
		put "responsetarget(main.cb_res4) "
		put "impulsevalue(" main.cb_imp4 ") "
		put "responsevalue(" main.cb_res4 ") "
		put "list(main.cb_irf4) "
		put "busyflag(isGettingIRFVars)"
		stata hidden
	}
END

PROGRAM main_update_vars5
BEGIN
	if ! isGettingIRF & ! isLoading & ! isGettingIRFVars {
		put "_set_irf_vars, "
		put "dialog(irf_ctable) "
		put "irfname("
			put /hidden main.cb_irf5
		put ") "
		put "impulsetarget(main.cb_imp5) "
		put "responsetarget(main.cb_res5) "
		put "impulsevalue(" main.cb_imp5 ") "
		put "responsevalue(" main.cb_res5 ") "
		put "list(main.cb_irf5) "
		put "busyflag(isGettingIRFVars)"
		stata hidden
	}
END

PROGRAM main_update_vars6
BEGIN
	if ! isGettingIRF & ! isLoading & ! isGettingIRFVars {
		put "_set_irf_vars, "
		put "dialog(irf_ctable) "
		put "irfname("
			put /hidden main.cb_irf6
		put ") "
		put "impulsetarget(main.cb_imp6) "
		put "responsetarget(main.cb_res6) "
		put "impulsevalue(" main.cb_imp6 ") "
		put "responsevalue(" main.cb_res6 ") "
		put "list(main.cb_irf6) "
		put "busyflag(isGettingIRFVars)"
		stata hidden
	}
END


INCLUDE irf_stat_list		// lists for statistics
INCLUDE irf_spec1_pr		// PROGs for stats1
INCLUDE irf_spec2_pr		// PROGs for stats2
INCLUDE irf_spec3_pr		// PROGs for stats3
INCLUDE irf_spec4_pr		// PROGs for stats4
INCLUDE irf_spec5_pr		// PROGs for stats5
INCLUDE irf_spec6_pr		// PROGs for stats6

PROGRAM step_check
BEGIN
	if main.ck_step {
		call gaction main.sp_step.enable
	}
	if ! main.ck_step {
		call gaction main.sp_step.disable
	}
END

PROGRAM command
BEGIN
	if !main.ck_spec1 ///
	 & !main.ck_spec2 ///
	 & !main.ck_spec3 ///
	 & !main.ck_spec4 ///
	 & !main.ck_spec5 ///
	 & !main.ck_spec6 ///
	{
		stopbox stop ///
		"On Main tab: at least one specification is required"
	}
	put "irf ctable "
	if main.ck_spec1 {
		put  "(" /program irf_spec1_output ") "
	}
	if main.ck_spec2 {
		put  "(" /program irf_spec2_output ") "
	}
	if main.ck_spec3 {
		put  "(" /program irf_spec3_output ") "
	}
	if main.ck_spec4 {
		put  "(" /program irf_spec4_output ") "
	}
	if main.ck_spec5 {
		put  "(" /program irf_spec5_output ") "
	}
	if main.ck_spec6 {
		put  "(" /program irf_spec6_output ") "
	}
	beginoptions
		option main.ck_indiv
		if main.ed_title {
			optionarg /quoted main.ed_title
		}
		if main.ck_step {
			optionarg main.sp_step
		}
		INCLUDE _level_main_pr
	endoptions
END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -