R: Estimation of the optimal number of factors of the FA model
nbfactors
R Documentation
Estimation of the optimal number of factors of the FA model
Description
The optimal number of factors of the FA model is estimated to minimize the variance of the number of false positives (see Friguet et al., 2009).
Usage
nbfactors(data, x = 1, test = x[1], pvalues = NULL, maxnbfactors = 8,
diagnostic.plot = FALSE, 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) on which the test is performed
pvalues
Vector of p-values for the individual tests. If NULL, the classical procedure is applied (see raw.pvalues)
maxnbfactors
The maximum number of factors for the FA model (8 by default)
diagnostic.plot
boolean (FALSE by default). If TRUE, the values of the variance inflation criteria for each number of factors are plotted
min.err
Stopping criterion value for iterations (default value : 0.001)
Value
optimalnbfactors
Optimal number of factors of the FA model (an elbow criterion is used)
criterion
Variance criterion for each number of factors
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
See Also
as.FAMTdata, emfa
Examples
## Reading 'FAMTdata'
data(expression)
data(covariates)
data(annotations)
chicken = as.FAMTdata(expression,covariates,annotations,idcovar=2)
# Estimation of the number of factors
## Not run: nbfactors(chicken,x=c(3,6),test=6)
# Estimation of the number of factors with a graph of variance inflation
# criterion
## Not run: nbfactors(chicken,x=c(3,6),test=6, diagnostic.plot=TRUE)
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/nbfactors.Rd_%03d_medium.png", width=480, height=480)
> ### Name: nbfactors
> ### Title: Estimation of the optimal number of factors of the FA model
> ### Aliases: nbfactors
>
> ### ** 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)
>
> # Estimation of the number of factors
> ## Not run: nbfactors(chicken,x=c(3,6),test=6)
>
> # Estimation of the number of factors with a graph of variance inflation
> # criterion
> ## Not run: nbfactors(chicken,x=c(3,6),test=6, diagnostic.plot=TRUE)
>
>
>
>
>
>
> dev.off()
null device
1
>