📄 ereg_lf.ado
字号:
*! version 6.0.3 17oct2002 (also see ereg.ado)
program define ereg_lf
version 6.0, missing
local b "`2'"
local f "`3'"
local g "`4'"
local D "`5'"
tempvar I lnf
quietly {
mat score double `I' = `b' if $EREGw
if `"$EREGoff"' != "" {
replace `I' = `I' + $EREGoff
}
gen double `lnf' = $EREGw*($EREGd*`I'-exp(`I')*$EREGt)
capture assert `lnf'<. if $EREGw
if _rc {
scalar `f' = .
exit
}
summ `lnf', meanonly
scalar `f' = r(sum) + $EREGa
}
/*
mleval `I' = `b'
mlsum `f' = $ML_w*($EREGd*`I'-exp(`I')*$EREGt)
*/
if `1'==0 { exit }
mlvecsum `f' `g' = $EREGw*($EREGd-exp(`I')*$EREGt)
mlmatsum `f' `D' = $EREGw*exp(`I')*$EREGt
end
exit
globals used:
macro EREGd name of 0/1 dead variable
macro EREGt name of time variable
macro EREGw weight variable; 0 if obs. not used
fweight: 0 or integer
aweight: 0 or pos. real, sums to _N
iweight: 0, or real,
macro EREGa (#) adjustment to log likelihood function
Note that weights on handled "on the side", outside of the knowledge of
-ml-. This is only because this program was translated from a version 5
routine.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -