| chisq_decomp | R Documentation |
Extracts the per-group contribution to the WLSMV (or ML) chi-square at each
invariance level of an esem_invariance object. Optionally compares
against Mplus's Chi-Square Contribution From Each Group table, which
is useful for pinpointing whether a basin difference between R and Mplus is
driven by a single group or distributed across all of them.
chisq_decomp(x, mplus_dir = NULL, levels = NULL)
x |
An |
mplus_dir |
Optional directory containing Mplus output files named
|
levels |
Character vector of levels to include. Defaults to all levels
present in |
lavaan's stat.group is the raw (unscaled) per-group chi-square; Mplus
prints the scaled per-group contribution that sums to the scaled
total. To compare on the same scale, R per-group values are rescaled by the
global ratio chisq.scaled / chisq from fitMeasures.
A data frame of class "chisq_decomp" with columns
level, group, chisq_R (rescaled to scaled scale), and
when mplus_dir is supplied, mplus_group, chisq_M,
delta.
data("HolzingerSwineford1939", package = "lavaan")
spec <- specify_model(
Visual = c("x1", "x2", "x3"),
Textual = c("x4", "x5", "x6"),
Speed = c("x7", "x8", "x9"),
data = HolzingerSwineford1939,
group = "school"
)
inv <- esem_invariance(spec)
chisq_decomp(inv)
## Not run:
# Supply a folder of Mplus .out files to add side-by-side deltas.
chisq_decomp(inv, mplus_dir = "validation/_bfi_g4_mplus_inv")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.