xtreg.dlg

来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· DLG 代码 · 共 239 行

DLG
239
字号
/*
  xtreg

*!  VERSION 1.1.3  27mar2005

  keyword:  eclass

*/

VERSION 9.0

INCLUDE _std_glm
INCLUDE _ht320
INCLUDE header

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

DIALOG main, ///
	label("xtreg - Fixed-, between-, random-effects, and population-averaged linear models") ///
	tabtitle("Model")
BEGIN
  DEFINE _x _xsetbu
  DEFINE _y _top
  INCLUDE _bu_panelset
  INCLUDE _dviv_ts4set

  CHECKBOX ck_nocons   @           _ms       @           .,		///
		label("Suppress constant term")				///
		option(noconstant)

  GROUPBOX gb_model    _lft        _ls       _iwd        _ht4,		///
		label("Model type (affects which options are available)")

  RADIO    rb_re       _ilft       _ss       _cwd3_2     .,		///
		label("GLS random-effects")				///
		onclickon(script re_opts)				///
		first							///
		option(re)

  RADIO    rb_be       _ilft3_2    @         @           .,		///
		label("Between-effects")				///
		onclickon(script be_opts)				///
		option(be)

  RADIO    rb_fe       _ilft3_3    @         @           .,		///
		label("Fixed-effects")					///
		onclickon(script fe_opts)				///
		option(fe)

  RADIO    rb_ml       _ilft       _ss       @           .,		///
		label("ML random-effects")				///
		onclickon(script ml_opts)				///
		option(mle)

  RADIO    rb_pa       _ilft3_2    @         @           .,		///
		label("Population-averaged")				///
		onclickon(script pa_opts)				///
		last							///
		option(pa)

  GROUPBOX gb_opts    _lft      _xls      _iwd      _ht10,		///
		label("Options")

  TEXT     tx_offset _ilft     _ss       _cwd2     .,			///
		label("Offset variable:")

  VARNAME  vn_offset @         _ss       _vnwd     .,			///
		label("Offset variable")				///
		option(offset)

  CHECKBOX ck_sa     @         _ls       _cwd2     .,			///
		label("Use the Swamy-Arora estimator")			///
		option(sa)

  CHECKBOX ck_wls    @         _ms       @         .,			///
		label("Use weighted least squares")			///
		option(wls)
END

SCRIPT re_opts
BEGIN
	main.tx_offset.disable
	main.vn_offset.disable
	main.ck_nocons.disable
	main.ck_sa.enable
	rpt.ck_theta.enable
	main.ck_wls.disable
	program check_se_status
	program disable_xtgee_common
	script max_internalFrom_on
	script max_internal_disable
	script weights_disable
	script weights_setLayout_fpi
END

SCRIPT be_opts
BEGIN
	main.tx_offset.disable
	main.vn_offset.disable
	main.ck_nocons.disable
	main.ck_sa.disable
	rpt.ck_theta.disable
	main.ck_wls.enable
	program check_se_status
	program disable_xtgee_common
	script max_internalFrom_on
	script max_internal_disable
	script weights_disable
	script weights_setLayout_fpi
END

SCRIPT fe_opts
BEGIN
	main.tx_offset.disable
	main.vn_offset.disable
	main.ck_nocons.disable
	main.ck_sa.disable
	rpt.ck_theta.disable
	main.ck_wls.disable
	program check_se_status
	program disable_xtgee_common
	script max_internalFrom_on
	script max_internal_disable
	script weights_disable
	script weights_setLayout_fpi
END

SCRIPT ml_opts
BEGIN
	main.tx_offset.disable
	main.vn_offset.disable
	main.ck_nocons.enable
	main.ck_sa.disable
	rpt.ck_theta.disable
	main.ck_wls.disable
	program check_se_status
	program disable_xtgee_common
	script max_pa_hide
	script max_internalFrom_on
	script max_internal_enable
	script weights_enable
	script weights_setLayout_i
END

SCRIPT pa_opts
BEGIN
	main.tx_offset.enable
	main.vn_offset.enable
	main.ck_nocons.enable
	main.ck_sa.disable
	rpt.ck_theta.disable
	main.ck_wls.disable
	program check_se_status
	program enable_xtgee_common
	script max_pa_on
	script weights_enable
	script weights_setLayout_fpi
END

INCLUDE xtgee_common
INCLUDE byif
INCLUDE weights
INCLUDE se

SCRIPT PREINIT
BEGIN
	script se_createAsGEE
END

PROGRAM check_se_status
BEGIN
	if main.rb_pa {
		call script se_setGEE_on
	}
	if !main.rb_pa {
		call script se_setGEE_off
		if main.rb_re {
			call script se_setClRobust_on
		}
		if main.rb_fe {
			call script se_setClRobust_on
		}
	}
END

SCRIPT POSTINIT
BEGIN
	script se_setRGF_on
	program check_se_status
	corr.settabtitle "PA options"
	corr.ck_force.show
	script max_internalFrom_on
	script max_internal_disable
	script weights_disable
	script weights_setLayout_fpi
END

DIALOG rpt, tabtitle("Reporting")
BEGIN
  DEFINE _x _lft
  DEFINE _cx _spr2
  DEFINE _y _top
  INCLUDE _sp_level

  CHECKBOX ck_theta    _lft        _ls        _iwd       .,		///
		label("Report theta (only available with random-effects)") ///
		option(theta)

END

INCLUDE max_ml

PROGRAM command
BEGIN
	allowxi
	INCLUDE _by_pr
	put "xtreg "
	varlist main.vn_dv [main.vl_iv]
	if !main.vl_iv & main.ck_nocons & !D(main.ck_nocons) {
	  stopbox stop `""Suppress constant term" is selected without independent variables."'
	}
	INCLUDE _if_pr
	INCLUDE _weights_pr
	beginoptions
		option main.ck_nocons
		option radio(main rb_re rb_be rb_fe rb_ml rb_pa)
		optionarg main.vn_offset
		option main.ck_sa
		option main.ck_wls
		put " " /program xtgee_common_output
		put " " /program se_output
		optionarg /hidedefault rpt.sp_level
		option rpt.ck_theta

		put " " /program max_output
	endoptions
END

⌨️ 快捷键说明

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