📄 _gmedian.ado
字号:
*! version 3.0.2 20oct2004
program define _gmedian
version 3.0, missing
local varlist "req new max(1)"
local exp "req nopre"
local if "opt"
local in "opt"
local options "by(string)"
parse "`*'"
tempvar touse x n
quietly {
gen byte `touse'=1 `if' `in'
gen double `x' = `exp'
sort `touse' `by' `x'
by `touse' `by': gen long `n'=sum(`x'<.)
by `touse' `by': replace `varlist' = ( /*
*/ `x'[(`n'[_N]+1)/2] + /*
*/ `x'[(`n'[_N]+2)/2] ) / 2 if `touse'==1
}
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -