Hi,
I'd like to replicate the coefficients obtained by 'poisson ;
offset' with MLE statements.
Here is an example that shows the differences.
Btw, is there a more efficient way of coding the MLE e.g. in case of
20 regressors?
Cheers
Leon
<hansl>
open rac3d.gdt --quiet
list X = SEX INCOME
# Poisson regression
poisson DVISITS 0 X
# Initial OLS to get starting values for the coefficients
ols DVISITS 0 X --quiet
list xList = $xlist
matrix b = zeros(1,nelem(xList))
mle loglik = DVISITS*Xb - exp(Xb)
series Xb = lincomb(xList,b)
deriv b = {DVISITS - exp(Xb), \
SEX*(DVISITS - exp(Xb)), \
INCOME*(DVISITS - exp(Xb))}
end mle --hessian
# Poisson regression with Offset
poisson DVISITS 0 X ; AGE
series DVISITS_off = DVISITS/AGE # try
mle loglik = DVISITS_off*Xb - exp(Xb)
series Xb = lincomb(xList,b)
deriv b = {DVISITS_off - exp(Xb), \
SEX*(DVISITS_off - exp(Xb)), \
INCOME*(DVISITS_off - exp(Xb))}
end mle --hessian
<hansl>