Description Usage Arguments Details Value Author(s) See Also Examples
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.
1 2 | 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
1 2 3 4 5 6 7 8 9 10 | ## 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)
|
ID Loc Block Trait TBV
1 ID1 1 1 15.34203 4.903431
2 ID1 1 2 14.28618 4.903431
3 ID1 2 1 15.45593 4.903431
4 ID1 2 2 15.03316 4.903431
5 ID1 3 1 23.67578 4.903431
6 ID1 3 2 18.38217 4.903431
Analysis of Variance Table
Response: Trait
Df Sum Sq Mean Sq F value Pr(>F)
ID 19 3267.2 171.96 7.8347 2.015e-12 ***
Loc 2 1069.7 534.87 24.3698 2.864e-09 ***
Loc:Block 3 234.4 78.13 3.5596 0.01715 *
Residuals 95 2085.1 21.95
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.