xtivreg.dlg

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

DLG
204
字号
/*
  xtivreg

*!  VERSION 1.1.1  28mar2005

  keyword:  eclass

*/

VERSION 9.0

INCLUDE _std_large
INCLUDE _ht330
INCLUDE header
HELP hlp1, view("help xtivreg")
RESET res1


DIALOG main, /*
*/ label("xtivreg - Instrumental variables regression for panel data")	/*
		*/ tabtitle("Model")
BEGIN
  /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+*/
  DEFINE _x _xsetbu
  DEFINE _y _top
  INCLUDE _bu_panelset
  INCLUDE _dviv_ts4set

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

  TEXT     tx_vars2  _lft      _ms       _iwd      .,			/*
		*/ label("Endogenous variables:")			/*
		*/
  VARLIST  vl_vars2  @         _ss       @         .,			/*
		*/ label("Endogenous variables")			/*
		*/ allowcat						/*
		*/ allowts						/*
		*/
  TEXT     tx_ivars  _lft      _ls       _iwd      .,			/*
		*/ label("Instrumental variables:")			/*
		*/
  VARLIST  vl_ivars  @         _ss       @         .,			/*
		*/ label("Instrumental variables")			/*
		*/ allowcat						/*
		*/ allowts						/*
		*/

  GROUPBOX gb_mopts  _lft      _ls       _iwd      _ht11,		/*
		*/ label("Options")					/*
		*/
  CHECKBOX ck_ec2sls _lft2     _ss       _cwd2     .,			/*
		*/ label("Use Baltagi's EC2SLS RE estimator")		/*
		*/ option("ec2sls")					/*
		*/
  DEFINE y @y
  CHECKBOX ck_nosa   @         _ls       @         .,			/*
		*/ label("Use the Baltagi-Chang instead of")		/*
		*/ option("nosa")					/*
		*/
  TEXT     tx_nosa   _indent2  _vss      _inwd     .,			/*
		*/ label(" the Swamy-Arora estimator")			/*
		*/
  CHECKBOX ck_reg    _lft2     _ms       _cwd2     .,			/*
		*/ label("Ignore instrumental variables and")		/*
		*/ clickon("gaction rpt.ck_first.disable")		/*
		*/ clickoff("gaction rpt.ck_first.enable")		/*
		*/ option("regress")					/*
		*/
  TEXT     tx_reg    _indent2  _vss      _inwd     .,			/*
		*/ label("treat all covariates as exogenous")		/*
		*/

  GROUPBOX gb_model  _ilft     y         _cwd2     _ht8,		/*
		*/ label("Model type")					/*
		*/
  RADIO    rb_re     _indent   _ss       _cwd4     .,			/*
		*/ label("Random-effects")				/*
		*/ clickon("script re_opts")				/*
		*/ first						/*
		*/ option("re")						/*
		*/
  RADIO    rb_be     @         _ss       @         .,			/*
		*/ label("Between-effects")				/*
		*/ clickon("script be_opts")				/*
		*/ option("be")						/*
		*/
  RADIO    rb_fe     @         _ss       @         .,			/*
		*/ label("Fixed-effects")				/*
		*/ clickon("script fe_opts")				/*
		*/ option("fe")						/*
		*/
  RADIO    rb_fd     @         _ss       @         .,			/*
		*/ label("First-differenced estimator")			/*
		*/ clickon("script fd_opts")				/*
		*/ last							/*
		*/ option("fd")						/*
		*/
END

SCRIPT re_opts
BEGIN
	main.ck_ec2sls.enable
	main.ck_nosa.enable
	main.tx_nosa.enable
	rpt.ck_theta.enable
	main.ck_nocons.disable
END

SCRIPT be_opts
BEGIN
	main.ck_ec2sls.enable
	main.ck_ec2sls.disable
	main.ck_nosa.disable
	main.tx_nosa.disable
	rpt.ck_theta.disable
	main.ck_nocons.disable
END

SCRIPT fe_opts
BEGIN
	script be_opts
END

SCRIPT fd_opts
BEGIN
	main.ck_ec2sls.enable
	main.ck_ec2sls.disable
	main.ck_nosa.disable
	main.tx_nosa.disable
	rpt.ck_theta.disable
	main.ck_nocons.enable
END

INCLUDE byifin
INCLUDE se

SCRIPT PREINIT
BEGIN
	script se_createAsJknifeBstrap
END

SCRIPT POSTINIT
BEGIN
	script se_setCluster_off
	script se_setTitleSE
END

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

  CHECKBOX ck_first  _lft      _ls       _iwd      .,			/*
		*/ label("Report first-stage estimates")		/*
		*/ option("first")					/*
		*/

  CHECKBOX ck_small  @         _ms       @         .,			/*
		*/ label("Report small-sample statistics: t, F instead of Z, chi-squared")/*
		*/ option("small")					/*
		*/
  CHECKBOX ck_theta  @        _ms        @         .,			/*
		*/ label("Report theta (only available with random-effects)") /*
		*/ option("theta")					/*
		*/
END

PROGRAM subcommand
BEGIN
	varlist main.vl_vars2
	put "="
	varlist main.vl_ivars
END

PROGRAM command
BEGIN
	allowxi
	INCLUDE _by_pr
	put "xtivreg "
	varlist main.vn_dv [main.vl_iv]
	put "("
	put /program subcommand
	put ")"
	INCLUDE _ifin_pr
	beginoptions
		option main.ck_nocons
		option radio(main rb_re rb_be rb_fe rb_fd)
		option main.ck_ec2sls
		option main.ck_nosa
		option main.ck_reg
		put " " /program se_output
		optionarg /hidedefault rpt.sp_level
		option rpt.ck_first
		option rpt.ck_small
		option rpt.ck_theta
	endoptions
END

⌨️ 快捷键说明

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