Var: Output Variance components for R packages

View source: R/basF.R View source: R/AF.Echidna.R

Var.esRR Documentation

Output Variance components for R packages

Description

Var This function output Variance components for R packages.

Usage

## S3 method for class 'esR'
Var(object)

Var(object, ...)

## S3 method for class 'lme'
Var(object)

## S3 method for class 'lmerMod'
Var(object)

## S3 method for class 'asreml'
Var(object)

## S3 method for class 'remlf90'
Var(object, mulT = FALSE)

Arguments

object

an object of mixed model results from R packages.

mulT

multi-trait model(default, FALSE).

Details

Output Variance component for mixed model results from R packages.

Value

the result is returned directly.

Author(s)

Yuanzhen Lin <yzhlinscau@163.com>

References

AFfR website:https://github.com/yzhlinscau/AFfR

Examples

library(AFEchidna)

## 00 data
data(butron.maize,package='agridat')
df<-butron.maize

## 01 nlme package
library(nlme) # V3.1-131

nlm<-lme(yield~1+env,random=~1|male/female,
               na.action='na.omit',
               data=df)

Var(nlm)

## 02 lme4 package
library(lme4) # V1.1-17

lme<-lmer(yield~1+env+(1|male)+(1|female),
               data=df)

Var(lme)

 ## Not run: 
## 03 breedR package
library(breedR) # V0.12-1

bdR <- remlf90(fixed = yield~1+env,
                      random = ~ male+female,
                      data=df)

Var(bdR)


## 04 asreml package
library(asreml) #V3.0

asr <- asreml(fixed = yield~1+env,
                      random = ~ male+female,
                      na.method.X='include',
                      data=df)

Var(asr)

##### special for breedR
library(breedR)

data(globulus)
res.animal <- remlf90(fixed = phe_X ~ 1,
                      random = ~ gg,
                      genetic = list(model = 'add_animal',
                      pedigree = globulus[, 1:3],
                      id = 'self'),
                      data = globulus)
Var(res.animal)

## End(Not run)



yzhlinscau/AAfun0s documentation built on April 18, 2023, 4:11 p.m.