penfaPredict {penfa} | R Documentation |
Compute the factor scores from a fitted penfa
model
Description
The penfaPredict
function estimates the factor scores
from a fitted penalized factor model. The factor scores are the estimated
values ("predictions") of the common factors.
Usage
penfaPredict(
object,
newdata = NULL,
method = "regression",
label = TRUE,
append.data = FALSE,
assemble = FALSE
)
Arguments
object |
An object of class |
newdata |
An optional data frame containing the same variables as the
ones appearing in the original data frame used for fitting the model in
|
method |
Character indicating the method for computing the factor
scores. Possible options are |
label |
Logical. If |
append.data |
Logical. If |
assemble |
Logical. If |
Value
A matrix with the factor scores from a fitted penfa
model.
References
Geminiani E. (2020), "A penalized likelihood-based framework for single and multiple-group factor analysis models" (Doctoral dissertation, University of Bologna). Available at http://amsdottorato.unibo.it/9355/.
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",
gamma = 4)
fscores <- penfaPredict(alasso_fit)