gendatafa_A {lazy.fa} | R Documentation |
Generate Simple Structure Factor Pattern
gendatafa_A(n, ndim, large = 0.8, small = 0.2, sd = 0.07, pc = 0, reorder = 0)
n |
# of variables |
ndim |
# of dimensions |
large |
The mean of large factor loadings |
small |
The mean of small factor loadings |
sd |
The standard deviation of factor loadings |
pc |
= 1 to rotate the result so that A'A=diag. |
reorder |
= 1 to reorder the rows by reorder_fa. |
First, an
Independent Cluster factor loadings matrix, A0, which is a
n x ndim block diagonal rectangular matrix consisting of 1s and 0s,
will be generated.
Then, the 1s will be replaced by the random variables from
N(large,sd^2), and 0s, by the ones from N(small,sd^2).
If pc=1, the above loadings matrix A will be rotated so that
t(A)%*%A=I
.
If reorder=1 or 2, the above A matrix will be reordered.
Therefore, if
resg=gendatafa_A(n,ndim, pc=1, reorder=2)
(resg$loadings01%*%resg$rotmat)[resg$row_order,resg$col_order]
make resg$loadings and A0 comparable.
large=1, small=0, sd=0, pc=0, reorder=0
will create
a 0-1 block diagonal matrix.
A list of
loadings = A matrix
loadings01 = A0 matrix
rotmat = The rotation matrix to pc
row_order = The row reorder index
col_order = The col reorder index
A01=gendatafa_A( 20, 4, large=1,small=0, pc=0, sd=0, reorder=0 ) A=gendatafa_A( 20, 4 )