knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-",
  message = FALSE,
  warning = FALSE
)
#library("txtplot")
library("badger")

rptR

Build Status CRAN total downloads Monthly downloads badge Codecov test coverage

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
#library("txtplot")
library("badger")

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. r badge_doi("https://doi.org/10.1111/2041-210X.12797", "green")

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)

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.