Learn R Programming

dmm (version 2.1-7)

condense.dmmblockarray: Condense an object of type dmmblockarray to an object of type dmm

Description

An object of class dmmblockarray is a list containing two items called array and blocks. Item array is an array of objects of type dmm, with each array element representing the reult of a dmm() analysis for one pair of blocks of traits. The function condense.dmmarray will recombine these results into a single object of class dmm with the variance component and genetic parameter estimates matrices being for all traits, and other elements of the \ codedmm object being appropriately pooled. Item blocks is a list, each element of which is a list of the traits present in each block.

Usage

condense.dmmblockarray(da)

Value

An object of class dmm, containing the recombined results for all traits.

Arguments

da

An object of class dmmblockarray

Author

Neville Jackson

Details

In bringing together the results of several traitsblockwise analyses into a single matrix of (for example) individual additive genetic variance/covariance components, one is putting together into one matrix elements estimated with different precisions due to differnt replication for each block of traits. The resulting matrix may not be positive definite even if all the contributing traitsblockwise ni x nj matrices are forced positive definite.

If the argument da contains results from a dmm run with gls=T then the GLS results for each traitblockpair will also be condensed. In this case the GLS results must be present for every traitblockpair. It can be quite difficult to get gls=T runs to converge successfully for every pair of blocks.

See Also

Functions dmm(), condense.dmmarray()

Examples

Run this code
library(dmm)
# prepare the dataset sheep.df
data(sheep.df)
# add a matrix 'Ymat' to the dataframe, which is required for traitsblockwise
# keep=TRUE also required
sheep.mdf <- mdf(sheep.df,pedcols=c(1:3),factorcols=c(4:6),ycols=c(7:9),
             sexcode=c("M","F"),keep=TRUE)
# make sheep.fit as a class dmmarray object
sheep.fit <- dmm(sheep.mdf, Ymat ~ 1 + Year + Sex,
    components=c("VarE(I)","VarG(Ia)"),traitsblockwise=TRUE,
    Block1=c("Cww","Diam"),Block2="Bwt")
#  look at one element of the dmmblockarray
summary(sheep.fit$array[["Block1","Block2"]])
# condense the dmmblockarray to a class dmm object
sheep.condense <- condense.dmmblockarray(sheep.fit)
# compute a response to selection
sheep.resp <- gresponse(sheep.condense,psd=list(dp=c(1,1,1)),effects=c("G(Ia)"))
# look at response object
summary(sheep.resp)
#cleanup
rm(sheep.df)
rm(sheep.mdf)
rm(sheep.fit)
rm(sheep.condense)
rm(sheep.resp)

Run the code above in your browser using DataLab