Skip to contents

Compute standard heritability using the classic ratio method of genotypic and phenotypic variance. See Falconer & Mackay (1996)

Usage

H2_Standard(model, target, options)

Arguments

model

Model object of class lmerMod/merMod or asreml

target

The name of the random effect for which heritability is to be calculated.

options

NULL by default, for internal checking of model object before calculations

Value

Numeric value

Details

The equation used to calculate standard heritability is: $$H^2_{Standard} = \frac{\sigma^2_g}{\sigma^2_g + \frac{1}{n_g}\sum_{n_g}^{i=1} \sigma^2_p / n_{gi}}$$ where:

  • \(n_g\) is the number of genotypes

  • \(n_{gi}\) is the number of replicate for a given genotype i

  • \(\sigma_g\) is the variance attributed to genotype differences

  • \(\sigma_p\) is the variance attributed to phenotypic differences

References

Falconer, D. S., & Mackay, T. F. C. (1996). Introduction to quantitative genetics (4th ed.). Longman.

Examples

# lme4 model
lettuce_subset <- lettuce_phenotypes |> subset(loc == "L2")
lettuce_lme4 <- lme4::lmer(y ~ rep + (1 | gen), data = lettuce_subset)
H2_Standard(lettuce_lme4, target = "gen")
#> [1] 0.8294971

# asreml model (Requires license)
if (FALSE) { # \dontrun{
lettuce_asreml <- asreml::asreml(fixed = y ~ rep,
                                 random = ~ gen,
                                 data = lettuce_subset,
                                 trace = FALSE
                                 )

H2_Standard(lettuce_asreml, target = "gen")
} # }