This function implements the whole FAMT procedure (including nbfactors and emfa). The number of factors considered in the model is chosen to reduce the variance of the number of the false discoveries. The model parameters are estimated using an EM algorithm. Factor-adjusted tests statistics are derived, as well as the corresponding p-values.
Usage
modelFAMT(data, x = 1, test = x[1], nbf = NULL, maxnbfactors = 8,
min.err = 0.001)
Arguments
data
'FAMTdata' object, see as.FAMTdata
x
Column number(s) corresponding to the experimental condition and the optional covariates (1 by default) in the covariates data frame.
test
Column number corresponding to the experimental condition (x[1] by default) one which the test is performed.
nbf
The number of factors of the FA model (NULL by default). If NULL, the function estimates the optimal nbf (see nbfactors)
maxnbfactors
The maximum number of factors (8 by default)
min.err
Stopping criterion value for iterations (default value:0.001)
Value
adjpval
Vector of FAMT factor-adjusted p-values
adjtest
Vector of FAMT factor-adjusted F statistics
adjdata
Factor-adjusted FAMT data
FA
Estimation of the FA model parameters
pval
Vector of classical p-values
x
Column number(s) corresponding to the experimental condition and the optional covariates in the covariates data frame
test
Column number corresponding to the experimental condition on which the test is performed
nbf
The number of factors used to fit the FA model
idcovar
The column number used for the array identification in the 'covariates' data frame
Note
The user can perform individual test statistics putting the number of factors (nbf) equal to zero.
The result of this function is a 'FAMTmodel'. It is used as argument in other functions of the package : summaryFAMT, pi0FAMT or defacto.
We advise to carry out a summary of FAMT model with the function summaryFAMT.
Author(s)
David Causeur
References
Friguet C., Kloareg M. and Causeur D. (2009). A factor model approach to multiple testing under dependence. Journal of the American Statistical Association, 104:488, p.1406-1415
## Reading 'FAMTdata'
data(expression)
data(covariates)
data(annotations)
chicken = as.FAMTdata(expression,covariates,annotations,idcovar=2)
# Classical method with modelFAMT
## Not run: modelpval=modelFAMT(chicken,x=c(3,6),test=6,nbf=0)
## Not run: summaryFAMT(modelpval)
# FAMT complete multiple testing procedure
# when the optimal number of factors is unknown
## Not run: model = modelFAMT(chicken,x=c(3,6),test=6)
# when the optimal number of factors has already been estimated
model = modelFAMT(chicken,x=c(3,6),test=6,nbf=3)
summaryFAMT(model)
hist(model$adjpval)
## End(Not run)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(FAMT)
Loading required package: mnormt
Loading required package: impute
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FAMT/modelFAMT.Rd_%03d_medium.png", width=480, height=480)
> ### Name: modelFAMT
> ### Title: The FAMT complete multiple testing procedure
> ### Aliases: modelFAMT
>
> ### ** Examples
>
> ## Reading 'FAMTdata'
> data(expression)
> data(covariates)
> data(annotations)
>
> chicken = as.FAMTdata(expression,covariates,annotations,idcovar=2)
$`Rows with missing values`
integer(0)
$`Columns with missing values`
integer(0)
>
> # Classical method with modelFAMT
> ## Not run: modelpval=modelFAMT(chicken,x=c(3,6),test=6,nbf=0)
> ## Not run: summaryFAMT(modelpval)
>
> # FAMT complete multiple testing procedure
> # when the optimal number of factors is unknown
> ## Not run:
> ##D model = modelFAMT(chicken,x=c(3,6),test=6)
> ##D
> ##D # when the optimal number of factors has already been estimated
> ##D model = modelFAMT(chicken,x=c(3,6),test=6,nbf=3)
> ##D
> ##D summaryFAMT(model)
> ##D hist(model$adjpval)
> ## End(Not run)
>
>
>
>
>
> dev.off()
null device
1
>