synbreed (version 0.12-6)

simul.phenotype:

Description

Simulates observations from a field trial using an animal model. The field trial consists of multiple locations and randomized complete block design within locations. A single quantitative trait is simulated according to the model Trait ~ id(A) + block + loc + e.

Usage

simul.phenotype(pedigree = NULL, A = NULL, mu = 100, vc = NULL,
                Nloc = 1, Nrepl = 1)

Arguments

pedigree
object of class "pedigree"
A
object of class "relationshipMatrix"
mu
numeric; Overall mean of the trait.
vc
list containing the variance components. vc consists of elements sigma2e, sigma2a, sigma2l, sigma2b with the variance components of the residual, the additive genetic effect, the location effect and the block effect.
Nloc
numeric. Number of locations in the field trial.
Nrepl
Numeric. Number of complete blocks within location.

Value

A data.frame with containing the simulated values for trait and the following variables
ID
Factor identifying the individuals. Names are extracted from pedigree or rownames of A
Loc
Factor for Location
Block
Factor for Block within Location
Trait
Trait observations
TBV
Simulated values for true breeding values of individuals
Results are sorted for locations within individuals.

Details

Either pedigree or A must be specified. If pedigree is given, pedigree information is used to set up numerator relationship matrix with function kinship. If unrelated individuals should be used for simulation, use identity matrix for A. True breeding values for \(N\) individuals is simulated according to following distribution $$tbv \sim N(0,\bf A \sigma_a^2)$$ Observations are simulated according to $$y \sim N(mu + tbv + block +loc,\sigma^2_e)$$ If no location or block effects should appear, use sigma2l=0 and/or sigma2b=0.

See Also

simul.pedigree

Examples

Run this code
## Not run: ------------------------------------
# ped <- simul.pedigree(gener=5)
# varcom <- list(sigma2e=25,sigma2a=36,sigma2l=9,sigma2b=4)
# # field trial with 3 locations and 2 blocks within locations
# data.simul <- simul.phenotype(ped,mu=10,vc=varcom,Nloc=3,Nrepl=2)
# head(data.simul)
# # analysis of variance
# anova(lm(Trait~ID+Loc+Loc:Block,data=data.simul))
## ---------------------------------------------

Run the code above in your browser using DataLab