📄 dfbeta.ado
字号:
*! version 4.0.2 23jul2000
program define dfbeta
version 6.0
_isfit cons
if "`*'"=="" {
GetRhs varlist
}
else {
syntax varlist
GetRhs rhs
tokenize `rhs'
local i 1
while "``i''"!="" {
local v`i' "``i''"
local i=`i'+1
}
tokenize `varlist'
while "`1'"!="" {
local found
local j 1
while "`v`j''"!="" & "`found'"=="" {
if "`1'"=="`v`j''" { local found true }
local j=`j'+1
}
if "`found'"=="" {
di in red "`1' not in model"
exit 111
}
mac shift
}
}
local len = cond(_caller()<7, 8, 32) - 2
tokenize `varlist'
local i 0
while "`1'"!="" {
local new ="DF"+substr("`1'",1,`len')
capture confirm new var `new'
while _rc {
local i=`i'+1
local new "DF`i'"
capture confirm new var `new'
}
predict float `new', dfbeta(`1')
di in gr %32s "`new'" ": DFbeta(`1')"
mac shift
}
end
program define GetRhs /* name */
args where
tempname b
mat `b' = get(_b)
local rhs : colnames `b'
mat drop `b'
local n : word count `rhs'
tokenize `rhs'
if "``n''"=="_cons" {
local `n'
}
c_local `where' "`*'"
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -