varcomp: Variance component estimation

View source: R/varcomp.R

varcompR Documentation

Variance component estimation

Description

Maximum Likelihood estimation of variance components using the eigenvalues and eigenvectors, which are derived from the eigendecomposition of a relationship matrix.

Usage

varcomp(y, Evector, Evalue)

Arguments

y

A vector including the phenotypes of n individuals.

Evector

A matrix (n x n) of eigenvectors.

Evalue

A vector of n eigenvalues.

Value

A list contains variance components

$Ve

An estimate of residual variance.

$Vu

An estimate of additive genetic variance.

Author(s)

Haipeng Yu and Gota Morota

Maintainer: Haipeng Yu haipengyu@vt.edu

Examples

# Load cattle data
data(GCcattle)

# Phenotype, fixed covariates and marker information
str(cattle.pheno)
str(cattle.W)

# Compute genomic relationship matrix
G <- computeG(cattle.W, maf = 0.05, impute = 'rbinom', method = 'G1')

# Eigendecomposition of genomic relationship matrix
EVD <- eigen(G)

# Estimate variance component
var <- varcomp(y = cattle.pheno$Phenotype, Evector = EVD$vectors, Evalue = EVD$values) 

# Retrieve additive genetic variance and residual variance
var$Vu
var$Ve

HaipengU/GCA documentation built on Oct. 1, 2023, 3:13 p.m.