simul.phenotype {synbreed} | R Documentation |
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
.
simul.phenotype(pedigree = NULL, A = NULL, mu = 100, vc = NULL, Nloc = 1, Nrepl = 1)
pedigree |
object of class "pedigree" |
A |
object of class "relationshipMatrix" |
mu |
|
vc |
list containing the variance components. |
Nloc |
|
Nrepl |
|
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 = chol(A)*sigma2a*rnorm(N,0,1)
Observations are simulated according to
If no location or block effects should appear, use sigma2l=0
and/or sigma2b=0
.
A data.frame
with containing the simulated values for trait and the following variables
ID |
Factor identifying the individuals. Names are extracted from |
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.
Valentin Wimmer
## 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)) ## End(Not run)