[R] Fit Negbin glm model with autoregressive correlation structure
Cristiano Varin
sammy at unive.it
Fri Jan 31 13:18:59 CET 2014
You may also introduce ARMA errors in negative binomial regression via Gaussian copulas. The following webpage illustrates how to use the package gcmr ("Gaussian Copula Marginal Regression") for fitting negative binomial regression model with ARMA(2,1) errors:
http://cristianovarin.weebly.com/gcmr.html
With best regards,
Cristiano Varin
---------------------------------------------
Cristiano Varin <cristiano.varin at unive.it>
Department of Environmental Sciences,
Informatics and Statistics
Ca' Foscari University of Venice
http://cristianovarin.weebly.com
Il 31/01/2014 09:41, flavie.vial at vetsuisse.unibe.ch ha scritto:
> Hello,
> I am attempting to estimate the effect of various variables on the time-series of counts of reported cattle stillbirths. We investigate the effect of day-of-week, month, holidays etc...and also the effect of non-temporal variables.
> We performed model comparisons between Gaussian glm, Poisson glm and negbin glm and the latter seems most appropriate for our data.
> We found that the residuals from our best model are not i.i.d. but follow an autoregressive process of order 5 , AR (5). I therefore wish to re-run this model after adding an AR(5) correlation structure in order to get unbiased estimates and standard errors for the variables retained in the model.
> In the past, I have been faced with a similar situation for a Gaussian glm and used the gls function with a corStruct object describing the within-group correlation structure. However, this would not work with our negbin model.
> Looking around on various help forums, I came across the possibilities of using generalized estimating equations instead.
> The gee function (in gee package) has a corstr object which would allow me to specify an AR process of whichever order but there is no option to include a negbin family.
> The geeglm function (in geepack package) does recognized the negbin family but only gives an option to fit an AR(1) correlation structure. The corstr object seems to have a "userdefined" option but it is unclear how it could be defined for an AR(5) process.
>
> In short, my questions are:
> *is it possible to include an AR (p) correlation structure directly into a negbin glm? How?
> * if GEE are the way forward, how can the the corstr object in geeglm be defined for an AR(p) process?
>
> Thank you for your suggestions,
>
> Dr Flavie Vial
> Veterinary Public Health Institute
> DCR-VPH, Vetsuisse Fakultät
> Schwarzenburgstrasse 155
> CH-3003 Bern
> Switzerland
>
> flavie.vial at vetsuisse.unibe.ch<mailto:flavie.vial at vetsuisse.unibe.ch>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
>
>
> ______________________________________________
>
> R-help at r-project.org
> mailing list
>
> https://stat.ethz.ch/mailman/listinfo/r-help
>
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
>
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list