Learn R Programming

FAMT (version 2.6)

nbfactors: 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

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

Run this code
# NOT RUN {
## 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)
# }
# NOT RUN {
# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab