📄 probit_p.ado
字号:
*! version 1.0.8 21jun2005
program define probit_p
version 6, missing
syntax [anything] [if] [in] [, SCores * ]
if `"`scores'"' != "" {
GenScores `0'
exit
}
/* 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 CONstant(varname)
SE:
Index XB STDP CONstant(varname)
*/
local myopts Pr
/* 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]
if "`pr'"=="" {
di in gr "(option p assumed; Pr(`e(depvar)'))"
}
_predict `vtyp' `varn' `if' `in', `offset'
if `"`e(prefix)'"' != "" {
quietly replace `varn' = norm(`varn')
}
label var `varn' "Pr(`e(depvar)')"
end
program GenScores, rclass
version 9, missing
syntax [anything] [if] [in] [, * ]
marksample touse
_score_spec `anything', `options'
local varn `s(varlist)'
local vtyp `s(typlist)'
tempvar xb
_predict double `xb' `if' `in', xb
quietly gen `vtyp' ///
`varn' = normden(`xb')/norm(`xb') if `e(depvar)' != 0
quietly replace ///
`varn' = -normden(`xb')/norm(-`xb') if `e(depvar)' == 0
local cmd = cond("`e(prefix)'"=="svy","svy:","")+"`e(cmd)'"
label var `varn' "equation-level score from `cmd'"
return local scorevars `varn'
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -