mixed: Solve Mixed Model

View source: R/mixed.R

mixedR Documentation

Solve Mixed Model

Description

Solve linear mixed model using restricted maximum likelihood (REML). Multiple variance components can be estimated.

Usage

mixed(fix = NULL, y, kk)

Arguments

fix

a design matrix of the fixed effects. If not passed, a vector of ones is added for the intercept.

y

a vector of the phenotypic values.

kk

a list of one or multiple kinship matrices.

Value

A list with following information is returned:

$v_i the inverse of the phenotypic variance-covariance matrix

$var estimated variance components of genetic effects

$ve estimated residual variance

$beta estimated fixed effects

References

Xu S, Zhu D and Zhang Q. (2014) Predicting hybrid performance in rice using genomic best linear unbiased prediction. Proc. Natl. Acad. Sci. USA 111, 12456-12461.

Examples


## load example data from hypred package
data(hybrid_phe)
data(input_geno)

## convert original genotype
inbred_gen <- convertgen(input_geno, type = "hmp2")

## infer the additive and dominance genotypes of hybrids
gena <- infergen(inbred_gen, hybrid_phe)$add
gend <- infergen(inbred_gen, hybrid_phe)$dom

## calculate the additive and dominance kinship matrix
ka <- kin(gena)
kd <- kin(gend)

## for the additive model
parm <- mixed(y = hybrid_phe[,3], kk = list(ka))

## for the additive-dominance model
parm <- mixed(y = hybrid_phe[,3], kk = list(ka, kd))



predhy documentation built on Nov. 10, 2022, 6:13 p.m.

Related to mixed in predhy...