This function generates the input for lambda arguments in latent variable models using a simple structure. The input is a vector with an element for each variable indicating the factor the variable loads on.
simplestructure(x)A binary lambda (factor loadings) matrix with one row per indicator and one column per factor, with a 1 in each cell where the indicator loads on the factor and 0 otherwise.
A vector indicating which factor each indicator loads on.
Sacha Epskamp <mail@sachaepskamp.com>