implied_scores {semfindr} | R Documentation |
Implied Scores of Observed Outcome Variables
Description
Gets a lavaan::lavaan()
output and computes the
implied scores of observed outcome variables.
Usage
implied_scores(fit, output = "matrix", skip_all_checks = FALSE)
Arguments
fit |
The output from |
output |
Output type. If |
skip_all_checks |
If |
Details
The implied scores for each observed outcome variable
(the y
-variables or the endogenous variables) are
simply computed in the same way the predicted scores in a linear
regression model are computed.
Currently it supports only single-group and multiple-group path analysis models with only observed variables. (Support for multiple-group models available in 0.1.4.8 and later version).
Value
A matrix of the implied scores if output
is "matrix"
.
If output
is "list"
, a list of matrices of the implied scores.
Author(s)
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448.
Examples
library(lavaan)
dat <- pa_dat
# For illustration, select only the first 50 cases
dat <- dat[1:50, ]
# The model
mod <-
"
m1 ~ iv1 + iv2
dv ~ m1
"
# Fit the model
fit <- lavaan::sem(mod, dat)
summary(fit)
# Compute the implied scores for `m1` and `dv`
fit_implied_scores <- implied_scores(fit)
head(fit_implied_scores)