getResiduals {pcgen}R Documentation

Residuals from the GBLUP

Description

Residuals from the best linear unbiased predictor of the genetic effects (GBLUP), which is computed given REML-estimates of the variance components.

Usage

 getResiduals(suffStat, covariates = NULL, cov.method = "uni", K = NULL) 

Arguments

suffStat

A data.frame, of which the first column is the factor G (genotype), and subsequent columns contain the traits. The name of the first column should be G.

covariates

A data.frame containing covariates, that should always be used in each conditional independence test. Should be either NULL (default) or a data.frame with the same number of rows as suffStat. An intercept is already included for each trait in suffStat; covariates should not contain a column of ones.

cov.method

(A string, specifying which method should be used to compute the GBLUP. Options are "us" (unstructured multi-trait model fitted using sommer) and "uni" (based on univariate GBLUPs). Default is "uni").

K

A genetic relatedness matrix. If NULL (default), independent genetic effects are assumed.

Details

If cov.method = "uni", the GBLUP and the residuals are computed separately for each trait in suffStat. The covariance of each trait is then assumed to be

σG2ZKZt+σE2In\sigma_G^2 Z K Z^t + \sigma_E^2 I_n

where ZZ is a binary incidence matrix, assigning plants or plots to genotypes. ZZ is based on the first column in suffStat. If there is a single observation per genotype (typically a genotypic mean), ZZ is the identity matrix, and the relatedness matrix KK should be specified. If there are replicates for at least some of the genotypes, and no KK is provided, independent genetic effects are assumed (KK will be the identity matrix). It is also possible to have replicates and specify a non-diagonal KK. Whenever KK is specified, sommer (mmer2) will be used; otherwise lmer (lme4). The mmer2 is also used when cov.method = "us", in which case the multivariate GBLUP is computed, for all traits in suffStat simultaneously. This is only possible for a limited number of traits.

Value

A data-frame with the residuals.

Author(s)

Willem Kruijer and Pariya Behrouzi. Maintainers: Willem Kruijer willem.kruijer@wur.nl and Pariya Behrouzi pariya.behrouzi@gmail.com

References

Covarrubias-Pazaran, G., 2016. Genome-assisted prediction of quantitative traits using the R package sommer. PloS one, 11(6), p.e0156744.

Examples

data(simdata)
rs <- getResiduals(suffStat= simdata)

[Package pcgen version 0.2.0 Index]