AIC(AF_NB2$model) The Negative Binomial with proportional extradispersion has a slightly lower AIC. Let's check the goodness of for for this model. set.seed(100) #AF_NB2.gof<-GOF_check(AF_NB2) In the The plot of RQR envelopes, all the original RQR lie within the envelopes, so the model fits correctly the data. plot(AF_NB2.gof,type="envelope") The dispersion of the original RQR is compatible with those simulated RQR, so that the dispersion estimated by the model is now correct. plot(AF_NB2.gof,type="dispersion") DispersionTest(AF_NB2.gof) Finally, the ICC estimate using this is: ICC(AF_NB2) and the variance components VarComp(AF_NB2) Example 2. Tick counts data In this study, the repeatability of line transects survey method to estimate tick abundance was assessed (Kjellander et al., 2021). With this aim, sampling was performed by two parallel transects separated by 1m-2m where the total count of ticks was recorded. In this analysis, every pair of transects are considered as replicates of a common transect. The ICC estimate assuming a Poisson distribution for the within-subjects variability is: G_P<-icc_counts(Grimso,y="Tot",id="TransectID") ICC(G_P) VarComp(G_P) When checking the GOF, if the plot function is applied with no value in the type argument, the three plots (envelopes, dispersion and zeros) are drawn. set.seed(100) #G_P.gof<-GOF_check(G_P) plot(G_P.gof) All the RQR are within the envelopes. Furthermore, the dispersion and the zero count are well fitted by the model. DispersionTest(G_P.gof) ZeroTest(G_P.gof) Example 3. Sparrow fledglings paternity The incidence of extra-pair paternity (EPP) was monitored over 3 breeding seasons in a sparrow colony in Lundy, an island off the southwest coast of England (Schroeder et al., 2012). Here, the repetability of counts of fledglings a male had in every breeding season is assessed. Let's begin by estimating the ICC assuming a Poisson distribution for the within-subjects variability, EPP_P<-icc_counts(EPP,y="Social",id="id") ICC(EPP_P) VarComp(EPP_P) Next, let's check the GOF. set.seed(100) #EPP_P.gof<-GOF_check(EPP_P) plot(EPP_P.gof,type="envelope") The envelopes plot show some residuals that lie outside the envelopes. plot(EPP_P.gof,type="dispersion") DispersionTest(EPP_P.gof) The dispersion is also greater than expected under a Poisson model. Finally, with regard of zero counts, plot(EPP_P.gof,type="zeros") ZeroTest(EPP_P.gof) The number of zeros in the sample is larger than expected under the Poisson assumption. Thus, it is necessary to try different models that can afford larger dispersion and number of zeros. Let's check if the negative binomial model can be such a model. EPP_NB1<-icc_counts(EPP,y="Social",id="id",fam="nbinom1") EPP_NB2<-icc_counts(EPP,y="Social",id="id",fam="nbinom2") AIC(EPP_NB1$model)
AIC(EPP_NB2\$model)

In this case, the negative binomial with additive extradispersion fits the data better. Let's check the GOF for this model.

set.seed(100)
#EPP_NB1.gof<-GOF_check(EPP_NB1)
plot(EPP_NB1.gof,type="envelope")

In the envelopes plot, the RQR behave much better than in the Poisson case, However, there still are some points that lie outside the envelopes.

plot(EPP_NB1.gof,type="dispersion")
DispersionTest(EPP_NB1.gof)

On the other hand, the sample dispersion is compatible to that from the simulated samples.

plot(EPP_NB1.gof,type="zeros")
ZeroTest(EPP_NB1.gof)

Finally, there still is an excess of zero counts. Hence, it is necessary to apply a model able to account for a larger number of zeros.

Let's try with the zero inflated Poisson model (ZIP). The ICC and variance components for this model are:

EPP_ZIP<-icc_counts(EPP,y="Social",id="id",fam="zip")
ICC(EPP_ZIP)
VarComp(EPP_ZIP)

Notice the excess of zeros is about 25% (pi estimate in the output).

Let's proceed by checking the GOF.

set.seed(100)
#EPP_ZIP.gof<-GOF_check(EPP_ZIP)
plot(EPP_ZIP.gof,type="envelope")

All the sample RQR are within the envelopes.

Furthermore, the dispersion and the zero counts are now compatible with the assumed model.

plot(EPP_ZIP.gof,type="dispersion")
DispersionTest(EPP_ZIP.gof)
plot(EPP_ZIP.gof,type="zeros")
ZeroTest(EPP_ZIP.gof)

References

Brooks ME, Kristensen K, van Benthem KJ, Magnusson A, Berg CW, Nielsen A, Skaug HJ, Maechler M, Bolker BM (2017). “glmmTMB Balances Speed and Flexibility Among Packages for Zero-inflated Generalized Linear Mixed Modeling.” The R Journal, 9(2), 378–400. https://journal.r-project.org/archive/2017/RJ-2017-066/index.html.

Carrasco, J. L. and Jover, L. (2003). Estimating the generalized concordance correlation coefficient through variance components. Biometrics 59, 849–858.

Carrasco, J. (2010). A Generalized Concordance Correlation Coefficient Based on the Variance Components Generalized Linear Mixed Models for Overdispersed Count Data. Biometrics, 66(3), 897-904.

Dunn PK, Smyth GK. (1996). Randomized quantile residuals. J Comput Graph Stat. 5(3):236–44.

Feng et al. (2020). A comparison of residual diagnosis tools for diagnosing regression models for count data. BMC Medical Research Methodology 20:175

Fleiss, J.L. (1986). Reliability of measurement. In The Design and Analysis of Clinical Experiments. New York: Wiley.

Fornas, O., Garcia, J., and Petriz, J. (2000). Flow cytometry counting of CD34+ cells in whole blood. Nature Medicine 6, 833–836.

Lin, L. I. K. (1989). A concordance correlation coefficient to evaluate reproducibility. Biometrics 45, 255–268.

Kjellander, P.L., Aronsson, M., Bergvall, U.A. et al. (2021). Validating a common tick survey method: cloth-dragging and line transects. Exp Appl Acarol 83, 131–146.

Schroeder, J., Burke, T., Mannarelli, M. E., Dawson, D. A., & Nakagawa, S. (2012). Maternal effects and heritability of annual productivity. Journal of Evolutionary Biology, 25, 149– 156.

Try the iccCounts package in your browser

Any scripts or data that you put into this service are public.

iccCounts documentation built on July 30, 2021, 5:07 p.m.