| penfaModel-class {penfa} | R Documentation |
S4 Class for internal representation of a factor model
Description
The penfaModel class gives the internal matrix
representation of a factor analysis model. Note that this representation
summarizes the characteristics of the model itself (e.g., number of items,
number of factors, parameter indices, etc), without information on the
penalization process (see penfaPenalty for that
aspect). This class is an adaptation of the lavModel class from the
lavaan package.
Slots
GLISTList. The model matrices and vectors: "lambda" for the factor loading matrix, "psi" for the covariance matrix of the unique factors, "phi" for the covariance matrix of the common factors, "tau" for the intercept vector, and "kappa" for the vector of factor means. In case of a multiple-group analysis, the elements of each group are presented sequentially.
dimNamesList. Dimension names (row names and column names) of every model matrix and vector.
isSymmetricLogical vector declaring whether each model matrix/vector is symmetric.
mmSizeInteger vector specifying the size (unique elements only) of each model matrix/vector.
meanstructureLogical. It declares whether the model includes a meanstructure.
ngroupsInteger. The number of groups.
nmatInteger vector specifying the number of model matrices/vectors for each group.
nvarInteger vector specifying the number of observed variables in each group.
num.idxList of the indices of the observed variables in each group.
nx.freeInteger. The number of parameters of the factor model. This count does not include the fixed parameters, but it does include the parameters that will be penalized (if any) during optimization. (see
penfaPenaltyfor additional details in this respect).nx.userInteger. The total count of the parameters that are being estimated and the ones that have been fixed.
m.free.idxList. For each model matrix, the indices of the elements to be estimated (i.e., non-fixed). The counter starts at 1 for every model matrix.
x.free.idxList. For each model matrix, the indices of the elements to be estimated (i.e., non-fixed). The counter continues from the previous model matrix.
m.user.idxList. Much like
m.free.idx, but it also contains the indices of the parameters that have been fixed by the user.x.user.idxList. Much like
x.free.idx, but it also contains the indices of the parameters that have been fixed by the user.x.free.var.idxVector of integers denoting the indices corresponding to the unique variances.
See Also
Examples
data(ccdata)
syntax = 'help =~ h1 + h2 + h3 + h4 + h5 + h6 + h7 + 0*v1 + v2 + v3 + v4 + v5
voice =~ 0*h1 + h2 + h3 + h4 + h5 + h6 + h7 + v1 + v2 + v3 + v4 + v5'
alasso_fit <- penfa(## factor model
model = syntax,
data = ccdata,
std.lv = TRUE,
## penalization
pen.shrink = "alasso",
eta = list(shrink = c("lambda" = 0.01), diff = c("none" = 0)),
## automatic procedure
strategy = "auto")
alasso_fit@Model