QGicc: Intra-Class Correlation coefficients (ICC) on the observed...

Description

Function to estimate the Intra-Class Correlation coefficients (ICC, a.k.a. repeatability-like estimates) on the observed scale based on estimates on the latent scale. For a specific variance component, the function yields a data.frame which includes the phenotypic mean and variance, as well as the variance component and associated ICC, on the observed data scale.

"Poisson.sqrt" Poisson distribution with a square-root link

width

Parameter for the integral computation. The integral is evaluated from -width*sqrt(var.comp) to width*sqrt(var.comp). The default value is 10, which should be sensible for most models. (numeric)

predict

Optional vector of predicted values on the latent scale (i.e. matrix product Xb). The latent predicted values must be computed while only accounting for the fixed effects (marginal to the random effects). (numeric)

closed.form

When available, should closed forms be used instead of integral computations? (boolean)

custom.model

If the model used is not available using the model argument, a list of functions describing the model can be provided. (list of functions, see Details)

n.obs

Number of "trials" for the "binomN" distribution. (numeric)

theta

Dispersion parameter for the Negative Binomial distribution. The parameter theta should be such as the variance of the distribution is mean + mean**2/theta. (numeric)

verbose

Should the function be verbose? (boolean)

Details

The function typically uses precise integral numerical approximation to compute parameters on the observed scale, from latent estimates yielded by a GLMM. If closed form solutions for the integrals are available, it uses them if closed.form=TRUE.

Only the most typical distribution/link function couples are implemented in the function. If you used an "exotic" GLMM, you can use the custom.model argument. It should take the form of a list of functions. The first function should be the inverse of the link function named inv.link, the second function should be the "distribution variance" function named var.func and the third function should be the derivative of the inverse link function named d.inv.link (see Example below).

Some distributions require extra-arguments. This is the case for "binomN", which require the number of trials N, passed with the argument n.obs. The distribution "negbin" requires a dispersion parameter theta, such as the variance of the distribution is mean + mean**2/theta (mean/dispersion parametrisation).

If fixed effects (apart from the intercept) have been included in the GLMM, they can be included as marginal predicted values, i.e. predicted values excluding the random effects, which can be calculated as the matrix product Xb where X is the design matrix and b is the vector of fixed effects estimates. To do so, provide the vector of marginal predicted values using the argument predict. Note this can considerably slow down the algorithm, especially when no closed form is used.