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

📄 gnbreg_p.ado

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 ADO
字号:
*! version 1.0.2  03jan2005
program define gnbreg_p
	version 9, missing

	syntax [anything] [if] [in] [, SCores SCORESLna * ]
	if `"`scores'`scoreslna'"' != "" {
		if "`scoreslna'" != "" {
			local scores scores
			local eq eq(#2)
		}
		ml_score `anything' `if' `in', `scores' `eq' `options'
		exit
	}
	version 6, missing

		/* Step 1:
			place command-unique options in local myopts
			Note that standard options are
			LR:
				Index XB Cooksd Hat 
				REsiduals RSTAndard RSTUdent
				STDF STDP STDR noOFFset
			SE:
				Index XB STDP noOFFset
		*/
	local myopts "N IR Alpha LNAlpha STDPLna"


		/* Step 2:
			call _propts, exit if done, 
			else collect what was returned.
		*/
	_pred_se "`myopts'" `0'
	if `s(done)' { exit }
	local vtyp  `s(typ)'
	local varn `s(varn)'
	local 0 `"`s(rest)'"'


		/* Step 3:
			Parse your syntax.
		*/
	syntax [if] [in] [, `myopts' noOFFset]


		/* Step 4:
			Concatenate switch options together
		*/
	local type "`n'`ir'`alpha'`lnalpha'`stpdlna'"


		/* Step 5:
			quickly process default case if you can 
			Do not forget -nooffset- option.
		*/

		/* Step 6:
			mark sample (this is not e(sample)).
		*/
	marksample touse


		/* Step 7:
			handle options that take argument one at a time.
			Comment if restricted to e(sample).
			Be careful in coding that number of missing values
			created is shown.
			Do all intermediate calculations in double.
		*/


		/* Step 8:
			handle switch options that can be used in-sample or 
			out-of-sample one at a time.
			Be careful in coding that number of missing values
			created is shown.
			Do all intermediate calculations in double.
		*/

	if "`type'"=="n" | "`type'"=="" {
		if "`type'"=="" {
			di in gr /*
			*/ "(option n assumed; predicted number of events)"
		}
		tempvar xb
		qui _predict double `xb' if `touse', xb `offset'
		gen `vtyp' `varn' = exp(`xb') if `touse'
		label var `varn' "predicted number of events"
		exit
	}

	if "`type'"=="ir" {
		tempvar xb
		qui _predict double `xb' if `touse', xb nooffset
		gen `vtyp' `varn' = exp(`xb') if `touse'
		label var `varn' "predicted incidence rate"
		exit
	}

	if "`type'"=="alpha" {
		tempvar xb2
		qui _predict double `xb2' if `touse', xb `offset' eq(#2)
		gen `vtyp' `varn' = exp(`xb2') if `touse'
		label var `varn' "predicted alpha"
		exit
	}

	if "`type'"=="lnalpha" {
		tempvar xb2
		_predict `vtyp' `varn' if `touse', xb `offset' eq(#2)
		label var `varn' "predicted ln(alpha)"
		exit
	}

	if "`type'"=="stdplna" {
		_predict `vtyp' `varn' if `touse', stdp `offset' eq(#2)
		label var `varn' "S.E. predicted ln(alpha)"
		exit
	}
		


	error 198
end

⌨️ 快捷键说明

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