get_fs | R Documentation |
Get Factor Scores and the Corresponding Standard Error of Measurement
get_fs(
data,
model = NULL,
group = NULL,
method = c("regression", "Bartlett"),
corrected_fsT = FALSE,
vfsLT = FALSE,
reliability = FALSE,
...
)
data |
A data frame containing indicators. |
model |
An optional string specifying the measurement model
in |
group |
Character. Name of the grouping variable for multiple group
analysis, which is passed to |
method |
Character. Method for computing factor scores (options are
"regression" or "Bartlett"). Currently, the default is
"regression" to be consistent with
|
corrected_fsT |
Logical. Whether to correct for the sampling error in the factor score weights when computing the error variance estimates of factor scores. |
vfsLT |
Logical. Whether to return the covariance matrix of |
reliability |
Logical. Whether to return the reliability of factor scores. |
... |
additional arguments passed to |
A data frame containing the factor scores (with prefix "fs_"
),
the standard errors (with suffix "_se"
), the implied loadings
of factor "_by_"
factor scores, and the error variance-covariance
of the factor scores (with prefix "evfs_"
). The following are
also returned as attributes:
* fsT
: error covariance of factor scores
* fsL
: loading matrix of factor scores
* fsb
: intercepts of factor scores
* scoring_matrix
: weights for computing factor scores from items
library(lavaan)
get_fs(PoliticalDemocracy[c("x1", "x2", "x3")])
# Multiple factors
get_fs(PoliticalDemocracy[c("x1", "x2", "x3", "y1", "y2", "y3", "y4")],
model = " ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4 ")
# Multiple-group
hs_model <- ' visual =~ x1 + x2 + x3 '
fit <- cfa(hs_model,
data = HolzingerSwineford1939,
group = "school")
get_fs(HolzingerSwineford1939, hs_model, group = "school")
# Or without the model
get_fs(HolzingerSwineford1939[c("school", "x4", "x5", "x6")],
group = "school")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.