Skip to contents

Make target rotation matrix for use with esem_efa().

Usage

make_target(nitems, mainloadings, bifactor = FALSE)

Arguments

nitems

An integer. The total number of items.

mainloadings

A list. A list indicating the indexes of the items related to each latent variable in a rotation matrix [nItems x nLatentVariables]. See examples.

bifactor

Logical. If TRUE, adds a G-factor column to the resulting target matrix.

Value

Target matrix with NAs and zeros [nItems x nLatentVariables].

Details

A target rotation matrix is composed of cells indicating which loadings should be freely estimated and which should be as close to zero as possible when the factor solution is rotated. Freely estimated loadings are represented with NAs. mainloadings identify which items are free for each latent variable. See the vignette esem as efa for suggestions on how to use.

Examples

#target matrix for the Tucker dataset in the psych package
main_loadings_list <- list(f1 = c(1,2,5:7),
                           f2 = c(3,4,8,9))
make_target(9, main_loadings_list)
#>       f1 f2
#>  [1,] NA  0
#>  [2,] NA  0
#>  [3,]  0 NA
#>  [4,]  0 NA
#>  [5,] NA  0
#>  [6,] NA  0
#>  [7,] NA  0
#>  [8,]  0 NA
#>  [9,]  0 NA

#bifactor matrix for the same dataset
make_target(9, main_loadings_list, TRUE)
#>       f1 f2  G
#>  [1,] NA  0 NA
#>  [2,] NA  0 NA
#>  [3,]  0 NA NA
#>  [4,]  0 NA NA
#>  [5,] NA  0 NA
#>  [6,] NA  0 NA
#>  [7,] NA  0 NA
#>  [8,]  0 NA NA
#>  [9,]  0 NA NA