Learn R Programming

agriutilities (version 1.2.1)

heritability_fa: Heritability for Factor Analytic Models in ASReml-R

Description

Heritability for Factor Analytic Models in ASReml-R

Usage

heritability_fa(
  model_fa = NULL,
  genotype = "line",
  env = "loc",
  vc_model = c("fa2"),
  diag = FALSE
)

Value

An object with a list of:

h2_cullis

A numerical value of the Cullis heritability estimate.

h2_se

A numerical value of the Cullis heritability estimate based on the standard error.

Arguments

model_fa

Factor Analytic ASReml model

genotype

A character string indicating the column in data that contains genotypes.

env

A character string indicating the column in data that contains environments or trials.

vc_model

A character string indicating the variance-covariance structure. Can be "fa1", "fa2", "fa3", "fa4" or "us".

diag

TRUE or FALSE depending on the user if they want to take the elements on the diagonal of the variance-covariance matrix or the elements out of the diagonal to estimate the heritability. FALSE by default.

Examples

Run this code
if (FALSE) {
library(agridat)
library(agriutilities)
data(besag.met)
dat <- besag.met
results <- check_design_met(
  data = dat,
  genotype = "gen",
  trial = "county",
  traits = c("yield"),
  rep = "rep",
  block = "block",
  col = "col",
  row = "row"
)
out <- single_trial_analysis(results, progress = FALSE)
met_results <- met_analysis(out, progress = FALSE)
model <- met_results$met_models$yield
heritability_fa(
   model_fa = model,
   genotype = "genotype",
   env = "trial",
   vc_model = "us"
 )
}

Run the code above in your browser using DataLab