MMBlup | R Documentation |
This function computes the BLUP for each random vector included in the MMEst
output. Note that this function can be called only if the argument X
of MMEst
was set to NULL
MMBlup(Y,Cofactor = NULL, X = NULL, fmla = NULL,ZList=NULL,VarList,ResMM)
Y |
The vector of response values used in the function |
Cofactor |
The incidence matrix corresponding to fixed effects common to all models to be adjusted used in the function |
X |
Must be |
fmla |
The formula object specifying the fixed effect part of all models separated by + operators used in the function |
ZList |
The list of incidence matrices associated with random and residual effects used in the function |
VarList |
The list of covariance matrices associated with random and residual effects used in the function |
ResMM |
A list as displayed by the |
The function returns a list where each element corresponds to the Best Linear Unbiased Prediction of a random component of the model.
GQMS CoreFunctions Team
require('MM4LMM') data(VarianceComponentExample) DataHybrid <- VarianceComponentExample$Data KinF <- VarianceComponentExample$KinshipF KinD <- VarianceComponentExample$KinshipD ##Build incidence matrix for each random effect Zf <- t(sapply(as.character(DataHybrid$CodeFlint), function(x) as.numeric(rownames(KinF)==x))) Zd <- t(sapply(as.character(DataHybrid$CodeDent), function(x) as.numeric(rownames(KinD)==x))) ##Build the VarList and ZList objects VL = list(Flint=KinF , Dent=KinD , Error = diag(1,nrow(DataHybrid))) ZL <- list(Flint=Zf , Dent=Zd , Error = diag(1,nrow(DataHybrid))) ##Perform inference #A first way to call MMEst ResultVA <- MMEst(Y=DataHybrid$Trait , Cofactor = matrix(DataHybrid$Trial) , ZList = ZL , VarList = VL) BlupVA <- MMBlup(Y=DataHybrid$Trait , Cofactor = matrix(DataHybrid$Trial) , ZList = ZL , VarList = VL , ResMM=ResultVA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.