Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2015 Sep 17:3:e1226.
doi: 10.7717/peerj.1226. eCollection 2015.

A practical guide and power analysis for GLMMs: detecting among treatment variation in random effects

Affiliations

A practical guide and power analysis for GLMMs: detecting among treatment variation in random effects

Morgan P Kain et al. PeerJ. .

Abstract

In ecology and evolution generalized linear mixed models (GLMMs) are becoming increasingly used to test for differences in variation by treatment at multiple hierarchical levels. Yet, the specific sampling schemes that optimize the power of an experiment to detect differences in random effects by treatment/group remain unknown. In this paper we develop a blueprint for conducting power analyses for GLMMs focusing on detecting differences in variance by treatment. We present parameterization and power analyses for random-intercepts and random-slopes GLMMs because of their generality as focal parameters for most applications and because of their immediate applicability to emerging questions in the field of behavioral ecology. We focus on the extreme case of hierarchically structured binomial data, though the framework presented here generalizes easily to any error distribution model. First, we determine the optimal ratio of individuals to repeated measures within individuals that maximizes power to detect differences by treatment in among-individual variation in intercept, among-individual variation in slope, and within-individual variation in intercept. Second, we explore how power to detect differences in target variance parameters is affected by total variation. Our results indicate heterogeneity in power across ratios of individuals to repeated measures with an optimal ratio determined by both the target variance parameter and total sample size. Additionally, power to detect each variance parameter was low overall (in most cases >1,000 total observations per treatment needed to achieve 80% power) and decreased with increasing variance in non-target random effects. With growing interest in variance as the parameter of inquiry, these power analyses provide a crucial component for designing experiments focused on detecting differences in variance. We hope to inspire novel experimental designs in ecology and evolution investigating the causes and implications of individual-level phenotypic variance, such as the adaptive significance of within-individual variation.

Keywords: Behavioral ecology; Binomial distribution; Hierarchical; Individual variation; Plasticity; Reaction norm; Sampling scheme.

PubMed Disclaimer

Conflict of interest statement

The authors declare there are no competing interests.

Figures

Figure 1
Figure 1. Reaction norm plots for a two treatment LMM.
In all graphs bolded black lines depict treatment mean reaction norms and thin lines depict reaction norms of individuals. Grey envelopes in (C) illustrate the magnitude of within-individual intercept variation. Here among-individual variation in intercept (A), slope (B), and within-individual variation in intercept (C) is larger in treatment 2.
Figure 2
Figure 2. Power to detect differences by treatment in among-indiviudal variation in intercept.
Power to detect differences in σ0k for three effect sizes (ratio of σ0k between treatments) and three TSST (total sample size per treatment). Colored circles indicate the ratio of individuals to sampling occasions that optimizes power for each effect size. Each scenario was simulated with 5 Bernoulli observations per sampling occasion.
Figure 3
Figure 3. Power to detect differences by treatment in among-indiviudal variation in slope.
Power to detect differences in σ1k for three effect sizes and three TSST. Colored circles indicate the ratio of individuals to sampling occasions that optimizes power for each effect size. Each scenario was simulated with 5 Bernoulli observations per sampling occasion.
Figure 4
Figure 4. Power to detect differences by treatment in within-indiviudal variation in intercept.
Power to detect differences in σvk for three effect sizes and three TSST. Colored circles indicate the ratio of individuals to Bernoulli observations that optimizes power for each effect size. Each scenario was simulated with 5 sampling occasions.
Figure 5
Figure 5. Power under increasing Bernoulli observations or sampling occasions.
Power to detect differences in σ0k (A) and σ1k (B) under increasing Bernoulli observations per sampling occasion; σvk (C) under increasing sampling occasions. In (A) and (B) ratios of individuals to sampling occasions follow Figs. 2B and 3B respectively. In (C) ratios of individuals to Bernoulli observations follows Fig. 4B. In (A) and (B) colored circles indicate the ratio of individuals to sampling occasions that optimizes power for each level of Bernoulli observations. In (C) colored circles indicate the ratio of individuals to Bernoulli observations that optimizes power for each level of sampling occasions.
Figure 6
Figure 6. Power under increasing non-target variation.
Power to detect differences in σ0k (A) and σ1k (B) under increasing variation in σvk; σvk (C) under increasing variation in σ0k. Noise is given as the ratio of effect size to variation in the non-target variance parameter. In (A) and (B) ratios of individuals to sampling occasions follow Figs. 2C and 3C respectively. In (C) ratios of individuals to Bernoulli observations follows Fig. 4C. Colored circles indicate the ratio of individuals to sampling occasions (A, B) or Bernoulli observations (C) that optimizes power for each level of noise.

Similar articles

Cited by

References

    1. Bates D, Maechler M, Bolker B, Walker S. Fitting linear mixed-effects models using lme4. 20141406.5823
    1. Bell AM, Hankison SJ, Laskowski KL. The repeatability of behaviour: a meta-analysis. Animal Behaviour. 2009;77:771–783. doi: 10.1016/j.anbehav.2008.12.022. - DOI - PMC - PubMed
    1. Benedetti-Cecchi L. The importance of the variance around the mean effect size of ecological processes. Ecology. 2003;84:2335–2346. doi: 10.1890/02-8011. - DOI
    1. Benedetti-Cecchi L, Bertocci I, Vaselli S, Maggi E. Temporal variance reverses the impact of high mean intensity of stress in climate change experiments. Ecology. 2006;87:2489–2499. doi: 10.1890/0012-9658(2006)87[2489:TVRTIO]2.0.CO;2. - DOI - PubMed
    1. Biro PA, Adriaenssens B. Predictability as a personality trait: consistent differences in intra-individual behavioral variation. The American Naturalist. 2013;182:621–629. doi: 10.1086/673213. - DOI - PubMed

Grants and funding

This research was supported through a new faculty start up grant from East Carolina University. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

LinkOut - more resources