README.md

rptR

Build Status CRAN total
downloads Monthly downloads
badge Codecov test
coverage

Goal

The goal of rptR is to provide point estimates, confidence intervals and significance tests for the repeatability (intra-class correlation coefficient) of measurements based on generalised linear mixed models (GLMMs). The function ?summary.rpt produces summaries in a detailed format, whereby ?plot.rpt plots the distributions of bootstrap or permutation test estimates.

Citation

When using rptR, please cite our paper:

Stoffel, M. A., Nakagawa, S., & Schielzeth, H. (2017). rptR: Repeatability estimation and variance decomposition by generalized linear mixed-effects models. Methods in Ecology and Evolution, 8(11), 1639-1644.

Installation

You can install the stable version of rptR from CRAN with:

install.packages("rptR")

Or the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("mastoffel/rptR", build_vignettes = TRUE, dependencies = TRUE) 
# manual
browseVignettes("rptR")

If you find a bug, please report a minimal reproducible example in the issues.

Example

Repeatability of beetle body length (BodyL) for both Container and Population while adjusting for Treatment and Sex:

library(rptR)
data(BeetlesBody)

rpts <- rpt(BodyL ~ Treatment + Sex + (1 | Container) + (1 | Population), 
            grname = c("Container", "Population"), data = BeetlesBody, 
            datatype = "Gaussian", nboot = 100, npermut = 100)
summary(rpts)
#> 
#> Repeatability estimation using the lmm method
#> 
#> Call = rpt(formula = BodyL ~ Treatment + Sex + (1 | Container) + (1 | Population), grname = c("Container", "Population"), data = BeetlesBody, datatype = "Gaussian", nboot = 100, npermut = 100)
#> 
#> Data: 960 observations
#> ----------------------------------------
#> 
#> Container (120 groups)
#> 
#> Repeatability estimation overview: 
#>       R     SE   2.5%  97.5% P_permut  LRT_P
#>  0.0834 0.0241 0.0486  0.139     0.01      0
#> 
#> Bootstrapping and Permutation test: 
#>             N    Mean  Median   2.5%  97.5%
#> boot      100 0.08886 0.08768 0.0486 0.1391
#> permut    100 0.00466 0.00138 0.0000 0.0184
#> 
#> Likelihood ratio test: 
#> logLik full model = -1528.553
#> logLik red. model = -1555.264
#> D  = 53.4, df = 1, P = 1.34e-13
#> 
#> ----------------------------------------
#> 
#> 
#> Population (12 groups)
#> 
#> Repeatability estimation overview: 
#>       R     SE   2.5%  97.5% P_permut  LRT_P
#>   0.491  0.103  0.232  0.652     0.04      0
#> 
#> Bootstrapping and Permutation test: 
#>             N   Mean Median   2.5%  97.5%
#> boot      100  0.451  0.452  0.232  0.652
#> permut    100  0.452  0.452  0.416  0.491
#> 
#> Likelihood ratio test: 
#> logLik full model = -1528.553
#> logLik red. model = -1595.399
#> D  = 134, df = 1, P = 3.19e-31
#> 
#> ----------------------------------------

Plotting

rptR estimates uncertainties around repeatability estimates with parametric bootstrapping. The distribution of bootstrap estimates can easily be plotted.

plot(rpts, grname="Container", type="boot", cex.main=0.8, col = "#ECEFF4")
plot(rpts, grname="Population", type="boot", cex.main=0.8, col = "#ECEFF4")



mastoffel/rptR documentation built on Aug. 7, 2021, 2 a.m.