fitting quasi family using glmulti?

。_饼干妹妹 提交于 2019-12-08 05:17:48

问题


I used the glmulti function in the glmulti package to obtain the best glm model for poisson error distributed data. No problems there. Once I had obtained the best model, I used the Chi-square test to obtain p-values and test statistics for each of the variables entered into the model. The only problem I am encountering is that the data is overdispersed and the Zuur book and Crawley both suggest using the quasi family function to correct for overdispersion. This in itself is not a problem except that the glmulti function does not allow fits to quasi functions.

The question I have, is whether obtaining my best model using glmulti with a poisson error distribution and then fitting the best model output to a quasi function is the incorrect way to go about doing things and if there are any other suggestions anyone could offer.

I also ran glmulti for normally distributed data (specifying family as gaussian and link as identity) and this did work, but if I am violating any major rules, please do let me know.


回答1:


glmulti does allow for quasi-families in the error distribution.

In your case, you should simply call glmulti with the additional argument family=quasipoisson (it will be passed to the fitting function glm).

Note that for this type of model you are using quasi-likelihoods, so that AIC or BIC are not recommended. You should use the quasi-equivalent of the latter (QAIC or QBIC). This is achieved by setting the argument crit to "qaic" (for instance). You will have to provide an estimate for the overdispersion factor, usually from the saturated model (see the documentation for more; or ask the package author for assistance).

Otherwise, there is no specific counter-indication to the use of multimodel comparison with this type of models.

Best




回答2:


Problem with the other answer that was suggested is that "qaic" doesn't seem to work in glmulti. For me this worked though:

library(bbmle)
qaicmod = function (fit) qAIC(fit, dispersion=with(fit,sum((weights * residuals^2)[weights > 0])/df.residual) ) 

glmulti.out <- glmulti(XXX model formula XXX, 
  data = mydata,crit = "qaicmod", 
   confsetsize = 5, fitfunction = "glm", 
   family = poisson)

This uses a regular poisson GLM but calculates the QAIC based on the estimated dispersion coefficient. In the dispersion argument of the qaicmod function you could also put the estimated dispersion coefficient of a full quasipoisson GLM with all variables included (some statisticions I have seen recommend this), i.e. to use instead

disp <<- summary(fullmodel)$dispersion
qaicmod = function (fit) qAIC(fit, dispersion=disp) 


来源:https://stackoverflow.com/questions/11468874/fitting-quasi-family-using-glmulti

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!