simul.phenotype: Simulation of a field trial with single trait

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/simul.phenotype.r

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

1
2
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.

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 = 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.

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.

Author(s)

Valentin Wimmer

See Also

simul.pedigree

Examples

 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)

synbreed documentation built on March 19, 2018, 3 p.m.