bsampl_w.ado

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

ADO
39
字号
*! version 2.0.0  15Sep1998
*  (see documentation below)
program define bsampl_w /* bwt */ 
	version 6.0
	local w "`1'"
	tempvar r
	quietly {
		drop `w'
		gen double `r' = int(uniform()*_N + 1)
		gen double `w' = uniform()
		sort `r' `w'
		replace `w' = cond(`r'==`r'[_n-1], `w'[_n-1]+1, 1)
		replace `w'=0 if !(`w'[_n+1]==1 | _n==_N)
	}
end
exit

DOCUMENTATION:

	bsampl_w wvar

where wvar must be already exist but the contents of wvar are irrelavant.

Description:

-bsampl_w-  is logically equivalent to -bsample- without arguements; 
it draws a subsample of size _N from a sample of _N.  -bsampl_w-, however,
returns a weighting variable wvar and some of the weights might be zero.

-bsampl_w- is for use in bootstrapping situations where the command being
bootstrapped allows frequency weights.

Also see
--------

comments at the end of qreg_c.ado

<end>

⌨️ 快捷键说明

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