| lavScores | R Documentation |
A function for extracting the empirical estimating functions of a fitted lavaan model. This is the derivative of the objective function with respect to the parameter vector, evaluated at the observed (case-wise) data. In other words, this function returns the case-wise scores, evaluated at the fitted model parameters.
estfun.lavaan(object, scaling = FALSE, ignore_constraints = FALSE,
remove_duplicated = TRUE, remove_empty_cases = TRUE, ...)
lavScores(object, scaling = FALSE, ignore_constraints = FALSE,
remove_duplicated = TRUE, remove_empty_cases = TRUE, ...)
object |
An object of class |
scaling |
Only used for the ML estimator. If |
ignore_constraints |
Logical. If |
remove_duplicated |
If |
remove_empty_cases |
If |
... |
To accept old argument names with dots. No other arguments are accepted. |
Casewise scores are available for the ML, GLS, ULS and WLS estimators, and
(since 0.7-1) for the PML (pairwise maximum likelihood) estimator. For PML,
the scores are the casewise derivatives of the pairwise log-likelihood
(including the weighted univariate part when
missing = "available.cases"); missing = "doubly.robust" is not
supported (yet). Exogenous covariates (conditional_x = TRUE) are
supported for PML only.
A n x k matrix corresponding to n observations and k parameters.
Ed Merkle for the ML case; the remove.duplicated,
ignore.constraints and remove.empty.cases arguments were added by
Yves Rosseel; Franz Classe for the WLS case; Yves Rosseel for the PML case.
## The famous Holzinger and Swineford (1939) example
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data = HolzingerSwineford1939)
head(lavScores(fit))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.