AnovaTest | R Documentation |
This function computes Type I and Type III tests for each fixed effect of a model, as displayed by the MMEst
function. Alternatively, a specific linear combination of the fixed parameters may be tested (at 0).
AnovaTest(ResMMEst , TestedCombination=NULL , Type = "TypeIII" ,
Cofactor = NULL , X = NULL , formula = NULL , VarList = NULL ,
NbCores=1)
ResMMEst |
A list as displayed by the |
TestedCombination |
A contrast matrix or a list of contrast matrices |
Type |
"TypeI", "TypeIII" or "KR" (default is "TypeIII"). AnovaTest will compute tests of the given type for each fixed effect in the model. The option is ignored if a |
Cofactor |
The incidence matrix corresponding to fixed effects common to all models used in |
X |
The incidence matrix or a list of incidence matrices corresponding to fixed effects specific to each model used in |
formula |
The formula object specifying the fixed effect part of all models separated by + operators used in |
VarList |
The list of correlation matrices associated with random and residual effects used in |
NbCores |
The number of cores to be used. |
If no TestedCombination
is provided, the function performs either Type I or Type III tests for each fixed effect in the model (default is Type III). If TestedCombination
is provided, each linear combination in TestedCombination
is tested at 0 using a Wald test. No check is performed regarding the estimability of the linear combination to be tested. If the dimension of the combination does not match with the dimension of ResMMEst
, a NA
is returned.
The output of the function is a list with as many items as in the original input list ResMMEst
. For each item of ResMMEst
, a table is provided that contains the Wald test statistics, p-values and degrees of freedom for all tested hypotheses.
F. Laporte and T. Mary-Huard
Kenward, M. G., & Roger, J. H. (1997). Small sample inference for fixed effects from restricted maximum likelihood. Biometrics, 983-997.
require('MM4LMM')
data(QTLDetectionExample)
Pheno <- QTLDetectionExample$Phenotype
Geno <- QTLDetectionExample$Genotype
Kinship <- QTLDetectionExample$Kinship
##Build the VarList object
VL <- list(Additive = Kinship , Error = diag(1,length(Pheno)))
##Perform inference
Result <- MMEst(Y=Pheno , X = Geno , VarList = VL)
##Compute tests
AOV <- AnovaTest(Result,Type="TypeI")
##Test specific contrast matrix
TC = matrix(c(0,1),nrow=1)
AOV2 <- AnovaTest(Result, TestedCombination = TC)
AOV3 <- AnovaTest(Result, TestedCombination = TC , Type="KR" , X = Geno , VarList = VL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.