Heritability for Factor Analytic Models in ASReml-R
Usage
heritability_fa(
model_fa = NULL,
genotype = "line",
env = "loc",
vc_model = c("fa2"),
diag = FALSE
)
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
orFALSE
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.
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.
Examples
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"
)
}