FAsim {FMradio}R Documentation

Simulate data according to the common factor analytic model

Description

FAsim is a function that enables the simulation of data according to the common factor analytic model.

Usage

FAsim(p, m, n, simplestructure = TRUE, balanced = TRUE,
      loadingfix = TRUE, loadingnegative = TRUE,
      loadingvalue = .8, loadingvaluelow = .2, numloadings,
      loadinglowerH = .7, loadingupperH = .9, 
      loadinglowerL = .1, loadingupperL = .3)

Arguments

p

A numeric integer or integer indicating the number of observed features.

m

A numeric integer or integer indicating the latent dimension of the factor solution (i.e., the number of factors).

n

A numeric integer or integer indicating the number of samples.

simplestructure

A logical indicating if the generating factor structure should be factorially pure.

balanced

A logical indicating if the high (i.e., qualitatively 'significant') loadings should be divided evenly over the respective factors.

loadingfix

A logical indicating if the loadings should have a fixed value.

loadingnegative

A logical indicating if, next to positive, also negative loadings should be present.

loadingvalue

A numeric indicating the value for high (i.e., qualitatively 'significant') loadings. Used when loadingfix = TRUE.

loadingvaluelow

A numeric indicating the value for low loadings. Used when loadingfix = TRUE & simplestructure = FALSE.

numloadings

A numeric vector with length equalling argument m, indicating the number of high (i.e., qualitatively 'significant') loadings per factor.
Used when balanced = FALSE.

loadinglowerH

A numeric indicating the lower-bound of high (i.e., qualitatively 'significant') loadings. Used when loadingfix = FALSE.

loadingupperH

A numeric indicating the upper-bound of high (i.e., qualitatively 'significant') loadings. Used when loadingfix = FALSE.

loadinglowerL

A numeric indicating the lower-bound of low (i.e., qualitatively 'non-significant') loadings. Used when loadingfix = FALSE & simplestructure = FALSE.

loadingupperL

A numeric indicating the upper-bound of low (i.e., qualitatively 'non-significant') loadings. Used when loadingfix = FALSE & simplestructure = FALSE.

Details

FAsim provides certain flexibility when generating data according to an orthogonal common factor-analytic model. It can produce data according to, for example, (i) factorially pure loadings structures, (ii) loadings-structures with only positive entries or both positive and negative loadings, (iii) loadings-structures with fixed values or varying values, (iv) balanced and unbalanced loadings-structures.

Value

The function returns an object of class list:

$data

A standardized data matrix of size n \times p.

$loadings

Loadings matrix of size p \times m on which the data-generation was based.

$Uniqueness

A numeric vector of size p representing the uniquenesses on which the data-generation was based.

$cormatrix

A p \times p correlation matrix based on the generated data in slot $data.

Note

Author(s)

Carel F.W. Peeters <cf.peeters@vumc.nl>

References

Ledermann, W. (1937). On the rank of the reduced correlational matrix in multiple factor analysis. Psychometrika, 2:85–93.

Peeters, C.F.W. et al. (2019). Stable prediction with radiomics data. arXiv:1903.11696 [stat.ML].

See Also

dimGB, mlFA, facScore

Examples

## Simulate some data according to a factor model with 3 latent factors
## Balanced and factorially pure loadings structure
simDAT <- FAsim(p = 24, m = 3, n = 40, loadingvalue = .9)
simDAT$loadings

## Simulate some data according to a factor model with 3 latent factors
## Unbalanced and factorially pure loadings structure
simDAT <- FAsim(p = 24, m = 3, n = 40, loadingvalue = .9,
                balanced = FALSE, numloadings = c(10,10,4))
simDAT$loadings

## Simulate some data according to a factor model with 3 latent factors
## Unbalanced and factorially non-pure loadings structure
simDAT <- FAsim(p = 24, m = 3, n = 40, loadingvalue = .9,
                balanced = FALSE, numloadings = c(10,10,4),
                simplestructure = FALSE)
simDAT$loadings

## Simulate some data according to a factor model with 3 latent factors
## Unbalanced and factorially non-pure loadings structure
## Non-fixed high and low loadings
simDAT <- FAsim(p = 24, m = 3, n = 40, loadingvalue = .9,
                balanced = FALSE, numloadings = c(10,10,4),
                simplestructure = FALSE, loadingfix = FALSE)
simDAT$loadings

[Package FMradio version 1.1.1 Index]