saberbouabid / cplm

Automatically exported from code.google.com/p/cplm
0 stars 0 forks source link

cpglm standard errors don't match dispersion estimate #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Thanks for making this package available!

The standard error estimates from "cpglm" look a bit odd. I think that they're 
using the estimate of dispersion (phi) from glm (which is a method of moments 
estimator, I think?) rather than the maximum likelihood estimate which cpglm 
reports.  I might be confused on some details of GLM estimation, though, sorry!

This follows the behavior of glm on other models, but since cpglm reports a 
maximum likelihood estimate of phi, I expected the standard errors would use 
that estimate as well.  An example is attached showing the difference in 
standard errors.

I think a fix might be as simple as changing the code in cpglm.profile that 
extracts the variance-covariance matrix from:
summary.glm(fit)$cov.scaled
to: summary.glm(fit, dispersion=phi.max)$cov.scaled

Original issue reported on code.google.com by danieljs...@gmail.com on 25 Mar 2014 at 7:28

Attachments: