_prefix_display.ado

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

ADO
124
字号
*! version 1.0.10  30mar2005
program _prefix_display, sortpreserve
	version 9
	is_svysum `e(cmd)'
	local is_sum = r(is_svysum)

	// only allow 'eform' options if NOT svy summary commands
	if ! `is_sum' {
		local regopts NEQ(integer -1) First PLus
		local star "*"
	}
	else	local neq -1
	if "`e(cmd)'" == "logistic" {
		local is_logistic 1
		local altopt "COEF"
	}
	else	local is_logistic 0
	syntax [,				///
		Level(cilevel)			///
		noHeader			///
		noLegend			///
		Verbose				///
		TItle(passthru)			///
		notable				/// not documented
		`regopts'			/// _coef_table options
		SVY				/// ignored
		`altopt'			///
		`star'				/// eform option
	]

	if `is_sum' & "`e(novariance)'" != "" {
		exit
	}

	if "`first'" != "" {
		local neq 1
	}
	if `neq' > 0 {
		local neqopt neq(`neq')
	}
	else	local neq

	// verify only valid -eform- option specified
	_check_eformopt `e(cmd)', eformopts(`options') soptions

	// check for total number of equations
	local k_eq 0
	Chk4PosInt k_eq
	if `k_eq' == 0 {
		local k_eq : coleq e(b), quote
		local k_eq : list clean k_eq
		local k_eq : word count `k_eq'
	}
	// check for auxiliary parameters
	local k_aux 0
	Chk4PosInt k_aux
	// check for extra equations
	local k_extra 0
	Chk4PosInt k_extra

	local blank
	if "`header'" == "" {
		_coef_table_header
		if "`legend'" == "" {
			if "`e(vce)'" != "" ///
			& ("`e(cmd)'" != "`e(cmdname)'" | "`verbose'" != "") {
				_prefix_legend `e(vce)', `verbose'
				if "`e(vce)'" == "jackknife" ///
				 & "`e(jkrweight)'" == "" ///
				 & "`e(wtype)'" != "iweight" ///
				 & ("`e(k_extra)'`verbose'" != "0" ///
				 |  "`e(k_eexp)'" == "0") {
					_jk_nlegend `s(col1)' ///
						`"`e(nfunction)'"'
					local blank blank
				}
			}
			if `is_sum' {
				_svy_summarize_legend `blank'
				local blank `s(blank)'
			}
		}
	}

	// check to exit early
	if ("`table'" != "") exit

	if "`header'`blank'" == "" {
		di
	}

	// display the table of coefficients
	if inlist("`e(vce)'","jackknife","brr") {
		local nodiparm nodiparm
	}
	if `is_sum' {
		_sum_table, level(`level')
	}
	else {
		if `is_logistic' & "`coef'`options'" == "" {
			local options or
		}
		_coef_table, level(`level') `neqopt' `first' `plus' ///
			`nodiparm' `options'
	}
	if "`plus'" == "" {
		_prefix_footnote
	}
end

program Chk4PosInt
	args ename
	if `"`e(`ename')'"' != "" {
		capture confirm integer number `e(`ename')'
		if !c(rc) {
			if `e(`ename')' > 0 {
				c_local `ename' `e(`ename')'
			}
		}
	}
end

exit

⌨️ 快捷键说明

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