_growsd.ado

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

ADO
39
字号
*! version 1.0.0  04oct2004
program define _growsd
	version 6, missing
	gettoken type 0: 0
	gettoken h    0: 0
	gettoken eqs  0: 0		/* discard = sign */

	syntax varlist(min=2) [if] [in] [, BY(string)]
	if `"`by'"' != "" {
		_egennoby rowsd() `"`by'"'
		/* NOTREACHED */
	}


	tempvar NOBS MU touse g
	mark `touse' `if' `in'
	quietly { 
		gen double `g' = 0 if `touse'
		gen double `MU' = 0 if `touse'
		gen long `NOBS' = 0 if `touse'
		tokenize `varlist'
		local i 1
		while "``i''"!="" {
			replace `MU' = `MU' + cond(``i''>=.,0,``i'') if `touse'
			replace `NOBS' = `NOBS' + (``i''<.) if `touse'
			local i = `i' + 1
		}
		replace `MU' = `MU' / `NOBS' if `touse'
		local i 1
		while "``i''" != "" { 
			replace `g'=`g'+cond(``i''>=.,0,``i''-`MU')^2 `if' `in'
			local i = `i' + 1
		}
		drop `MU'
		gen `type' `h' = /*
			*/ cond(`NOBS'==0,.,sqrt(`g'/(`NOBS'-1))) if `touse'
	}
end

⌨️ 快捷键说明

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