Learn R Programming

fullfact (version 1.0)

powerGlmer2: Power analysis for non-normal data 2

Description

Extracts the power values of dam, sire, and dam by sire variance components from a generalized linear mixed-effect model using the glmer function of the lme4 package. Options to include one random position and/or one random block effect(s).

Usage

powerGlmer2(varcomp, nval, fam_link, alpha = 0.05, nsim = 100, position = NULL, block = NULL, poisLog = NULL)

Arguments

varcomp
Vector of known dam, sire, dam by sire, and position and/or block variance components, i.e. c(dam,sire,ds,position/block). If there is a position and a block c(..., ds, position, block).
nval
Vector of known dam, sire, offspring per family, and position and/or block sample sizes, i.e. c(dam,sire,offspring,position/block). If there is a position and a block c(..., offspring, position, block).
fam_link
The family and link in family(link) format. Supported options are binomial(logit), binomial(probit), poisson(log), and poisson (sqrt).
alpha
Statistical significance value. Default is 0.05.
nsim
Number of simulations. Default is 100.
position
Optional number of replicates to divide the number of offspring for the number of positions.
block
Optional vector of dams and sires per block, e.g. c(2,2).
poisLog
Known poisson(log) variance component value.

Value

A data frame with the sample sizes, variance component inputs, variance component outputs, and power values.

Details

Extracts the dam, sire, dam, dam by sire, and position and/or block power values. The residual variance component for the fam_links are described by Nakagawa and Schielzeth (2010, 2013). Power values are calculated by stochastically simulation data and then calculating the proportion of significance values less than alpha for each component (Bolker 2008). Significance values for the random effects are determined using likelihood ratio tests (Bolker et al. 2009).

References

Bolker BM. 2008. Ecological models and data in R. Princeton University Press, New Jersey.

Bolker BM, Brooks ME, Clark CJ, Geange SW, Poulsen JR, Stevens MHH, White J-SS. 2009. Generalized linear mixed models: a practical guide for ecology and evolution. Trends in Ecology and Evolution 24(3): 127-135. DOI: 10.1016/j.tree.2008.10.008

Lynch M, Walsh B. 1998. Genetics and Analysis of Quantitative Traits. Sinauer Associates, Massachusetts.

Nakagawa S, Schielzeth H. 2010. Repeatability for Gaussian and non-Gaussian data: a practical guide for biologists. Biological Reviews 85(4): 935-956. DOI: 10.1111/j.1469-185X.2010.00141.x

Nakagawa S, Schielzeth H. 2013. A general and simple method for obtaining R2 from generalized linear mixed-effects models. Methods in Ecology and Evolution 4(2): 133-142. DOI: 10.1111/j.2041-210x.2012.00261.x

See Also

powerGlmer, powerGlmer3

Examples

Run this code
#100 simulations
## Not run: pwr_G2<- powerGlmer2(varcomp=c(1,0.15,0.11,0.5),nval=c(10,10,20,10),
# fam_link=binomial(logit),position=2)
# pwr_G2## End(Not run)

Run the code above in your browser using DataLab