When creating a structural diagram or a structural model, it is convenient to not have to specify all of the zero loadings in a structural matrix. structure.list converts list input into a design matrix. phi.list does the same for a correlation matrix. Factors with NULL values are filled with 0s.

structure.list(nvars, f.list,f=NULL, f.labels = NULL, item.labels = NULL)
phi.list(nf,f.list, f.labels = NULL)

Arguments

nvars

Number of variables in the design matrix

f.list

A list of items included in each factor (for structure.list, or the factors that correlate with the specified factor for phi.list

f

prefix for parameters – needed in case of creating an X set and a Y set

f.labels

Names for the factors

item.labels

Item labels

nf

Number of factors in the phi matrix

Details

This is almost self explanatory. See the examples.

Value

factor.matrix

a matrix of factor loadings to model

See also

structure.graph for drawing it, or sim.structure for creating this data structure.

Examples

fx <- structure.list(9,list(F1=c(1,2,3),F2=c(4,5,6),F3=c(7,8,9)))
fy <- structure.list(3,list(Y=c(1,2,3)),"Y")
phi <- phi.list(4,list(F1=c(4),F2=c(1,4),F3=c(2),F4=c(1,2,3)))
fx
#>       F1   F2   F3  
#>  [1,] "a1" "0"  "0" 
#>  [2,] "a2" "0"  "0" 
#>  [3,] "a3" "0"  "0" 
#>  [4,] "0"  "b4" "0" 
#>  [5,] "0"  "b5" "0" 
#>  [6,] "0"  "b6" "0" 
#>  [7,] "0"  "0"  "c7"
#>  [8,] "0"  "0"  "c8"
#>  [9,] "0"  "0"  "c9"
phi
#>    F1    F2    F3    F4   
#> F1 "1"   "rba" "0"   "rda"
#> F2 "0"   "1"   "rcb" "rdb"
#> F3 "0"   "0"   "1"   "rdc"
#> F4 "rad" "rbd" "0"   "1"  
fy
#>      Y    
#> [1,] "Ya1"
#> [2,] "Ya2"
#> [3,] "Ya3"