Description Usage Arguments Examples
Calculate the least-significant difference among the means of genotypes from a fitted model object.
1 2 3 4 5 6 7 8 9 |
object |
A model object of class |
geno.term |
A character vector giving the model term for genotypes. |
env.term |
A character vector giving the model term for environments. If |
ge.term |
A character vector giving the model term for genotype-by-environment interaction. |
alpha |
The significance level at which to calculate the LSD. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Use the gauch.soy dataset
data("gauch.soy")
# Filter
gauch_soy1 <- gauch.soy %>%
group_by(env) %>%
filter(n_distinct(gen, rep) == 28)
# Fit a linear model using lm
mod <- lm(yield ~ gen + env + gen:env, data = gauch_soy1)
# Calculate heritability
lsd(object = mod, geno.term = "gen", env.term = "env", ge.term = "gen:env", alpha = 0.05)
# Fit a mixed-effects model with lmer
mod1 <- lmer(yield ~ (1|gen) + env + (1|gen:env), data = gauch_soy1)
# Calculate heritability
lsd(object = mod1, geno.term = "gen", env.term = "env", ge.term = "gen:env")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.