structure.list.Rd
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)
Number of variables in the design matrix
A list of items included in each factor (for structure.list, or the factors that correlate with the specified factor for phi.list
prefix for parameters – needed in case of creating an X set and a Y set
Names for the factors
Item labels
Number of factors in the phi matrix
This is almost self explanatory. See the examples.
a matrix of factor loadings to model
structure.graph
for drawing it, or sim.structure
for creating this data structure.
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"