R: Create factor model matrices from an input list

structure.list {psych} | R Documentation

## Create factor model matrices from an input list

### Description

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.

### Usage

    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
    phi
    fy

[Package psych version 1.7.8 Index]