FAsim: Simulate data according to the common factor analytic model

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/FMradio.R

Description

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

Usage

1
2
3
4
5
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## 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

FMradio documentation built on Dec. 16, 2019, 5:43 p.m.