Skip to contents

Returns the per-trait repeatability \(R_t = \sigma^2_{B,t} / (\sigma^2_{B,t} + \sigma^2_{W,t})\) for a fitted gllvmTMB_multi model with both unique(0 + trait | <unit>) and unique(0 + trait | <obs>) terms. Also known as the intraclass correlation coefficient (ICC) at the unit level.

Usage

extract_repeatability(
  fit,
  level = 0.95,
  method = c("profile", "wald", "bootstrap"),
  nsim = 500L,
  seed = NULL
)

Arguments

fit

A gllvmTMB_multi fit returned by gllvmTMB.

level

Confidence level. Default 0.95.

method

One of "profile" (default), "wald", "bootstrap".

nsim

Number of bootstrap replicates when method = "bootstrap". Default 500.

seed

Optional RNG seed for the bootstrap.

Value

A data frame with columns trait, R (point estimate), lower, upper, method.

Method choice

  • "profile": profile-likelihood CI via the linear contrast \(2(\theta_B - \theta_W)\) in TMB::tmbprofile(). Fast and accurate.

  • "wald": Gaussian-approximation CI via the delta method on plogis(2*(theta_B - theta_W)).

  • "bootstrap": parametric bootstrap via bootstrap_Sigma().

References

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

Examples

if (FALSE) { # \dontrun{
fit <- gllvmTMB(
  value ~ 0 + trait +
          latent(0 + trait | site, d = 1) +
          unique(0 + trait | site) +
          unique(0 + trait | site_species),
  data = df
)
extract_repeatability(fit)
} # }