[R-sig-ME] Cook's distance for glmmTMB models

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Wed Nov 20 17:38:26 CET 2019

Dear Mike,

I don't know about packages that will directly work with glmmTMB objects, but computing Cook's distances can be easily done by hand. Let b be the vector with the estimated fixed effects from the model and V(b) the corresponding var-cov matrix. You can extract these with fixef() and vcov() from your model. Now leave out either a single observation or a cluster of observations (e.g., all observations corresponding to an individual) and let b_{-i} denote the estimated fixed effects when fitting the data to this subset of the dataset. Then Cook's distances is simply

D_i = (b - b_{-i})' V(b)^{-1} (b - b_{-i})

Now rinse and repeat for every i, which is easily done in a loop. It might take a while to complete depending on how complex your model is.

Some might compute D_i with V(b_{-i})^{-1} in place of V(b)^{-1}. Can be done easily at the same time, so you could do both and compare.


-----Original Message-----
From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces using r-project.org] On Behalf Of Williamson, Michael via R-sig-mixed-models
Sent: Tuesday, 19 November, 2019 11:53
To: r-sig-mixed-models using r-project.org
Subject: [R-sig-ME] Cook's distance for glmmTMB models

Good Morning,

I've been running a generalise linear mixed model using the glmmTMB package. My data is very large and zero inflated and this packaged worked really well following convergent issues using the traditional lme4 package.

I've been recommended to check for the effect of outliers using Cook's distance, but none of the packages I can find (performance and influence.ME) work with glmmTMB models currently. Is anyone aware of any other methods I might be able to use to check for Cook's distance with glmmTMB objects?



More information about the R-sig-mixed-models mailing list