Abstract
Traditional regression models, including generalized linear mixed models, focus on understanding the deterministic factors that affect the mean of a response variable. Many biological studies seek to understand non-deterministic patterns in the variance or dispersion of a phenotypic or ecological response variable. We describe a new R package, dalmatian, that provides methods for fitting double hierarchical generalized linear models incorporating fixed and random predictors of both the mean and variance. Models are fit via Markov chain Monte Carlo sampling implemented in either JAGS or nimble and the package provides simple functions for monitoring the sampler and summarizing the results. We illustrate these functions through an application to data on food delivery by breeding pied flycatchers (Ficedula hypoleuca). Our intent is that this package makes it easier for practitioners to implement these models without having to learn the intricacies of Markov chain Monte Carlo methods.
Highlights
Linear models and their extensions, including generalized linear models, generalized additive models, and even random or mixed effects models, focus on describing how the mean of a dalmatian: Doubly Hierarchical Models in R via JAGS and nimble response variable varies either as a function of known explanatory variables or as a result of unexplained variation between observational units
Ecological and organismal variation exists in hierarchical structures: population dynamics vary with spatial scale (e.g., Bjørnstad, Ims, and Lambin 1999; Liebhold, Koenig, and Bjørnstad 2004), indices of diversity vary with spatial scale and trophic level (e.g, Willig, Kaufman, and Stevens 2003), and phenotypes vary within, among individuals, and among higher taxonomic units (e.g., Westneat, Wright, and Dingemanse 2015)
The dalmatian package facilitates fitting of double hierarchical generalized linear models (DHGLM) in R (R Core Team 2021) via Markov chain Monte Carlo (MCMC) sampling implemented in JAGS (Plummer 2003) or nimble
Summary
Linear models and their extensions, including generalized linear models, generalized additive models, and even random or mixed effects models, focus on describing how the mean of a dalmatian: Doubly Hierarchical Models in R via JAGS and nimble response variable varies either as a function of known explanatory variables or as a result of unexplained variation between observational units. Linear mixed effects models provide an important tool for describing patterns in variance and covariance, but impose the assumption of constant residual variance conditional on the fixed and random effects in the mean This assumption may be violated, and recent work has shown that residual variance may differ as the result of some relatively under-studied ecological or evolutionary processes (Westneat et al 2015) and may exhibit hierarchical structure itself (Westneat, Schofield, and Wright 2012). The dalmatian package facilitates fitting of double hierarchical generalized linear models (DHGLM) in R (R Core Team 2021) via Markov chain Monte Carlo (MCMC) sampling implemented in JAGS (Plummer 2003) or nimble (de Valpine, Turek, Paciorek, AndersonBergman, Temple Lang, and Bodik 2017; de Valpine, Paciorek, Turek, Michaud, AndersonBergman, Obermeyer, Wehrhahn Cortes, Rodríguez, Temple Lang, and Paganin 2020) These models extend traditional generalized linear mixed effects models (GLMM) by allowing the dispersion parameter to depend on both fixed and random effects. Our hope is that this makes these complex models more accessible to other researchers who are interested in modeling changes in the variability in ecological problems, or in any other field
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have