relcorr_single_item {modsem} | R Documentation |
Reliability‑Corrected Single‑Item SEM
Description
Replace (some of) the first‑order latent variables in a lavaan measurement
model by single composite indicators whose error variances are fixed from
Cronbach's \alpha
. The function returns a modified lavaan model
syntax together with an augmented data set that contains the newly created
composite variables, so that you can fit the full SEM in a single step.
Usage
relcorr_single_item(
syntax,
data,
choose = NULL,
scale.corrected = TRUE,
warn.lav = TRUE
)
Arguments
syntax |
A character string containing lavaan model syntax. Must at
least include the measurement relations ( |
data |
A |
choose |
Optional. Character vector with the names of the latent
variables you wish to replace by single indicators. Defaults to all
first‑order latent variables in |
scale.corrected |
Should reliability-corrected items be scale-corrected? If |
warn.lav |
Should warnings from |
Details
The resulting object can be fed directly into modsem
or lavaan::sem
by supplying syntax = $syntax
and data = $data
.
Value
An object of S3 class modsem_relcorr
(a named list) with elements:
syntax
Modified lavaan syntax string.
data
Data frame with additional composite indicator columns.
parTable
Parameter table corresponding to 'syntax'.
reliability
Named numeric vector of reliabilities (one per latent variable).
AVE
Named numeric vector with Average Variance Extracted values.
lVs
Character vector of latent variables that were corrected.
single.items
Character vector with names for the generated reliability corrected items
Examples
## Not run:
tpb_uk <- "
# Outer Model (Based on Hagger et al., 2007)
ATT =~ att3 + att2 + att1 + att4
SN =~ sn4 + sn2 + sn3 + sn1
PBC =~ pbc2 + pbc1 + pbc3 + pbc4
INT =~ int2 + int1 + int3 + int4
BEH =~ beh3 + beh2 + beh1 + beh4
# Inner Model (Based on Steinmetz et al., 2011)
INT ~ ATT + SN + PBC
BEH ~ INT + PBC
BEH ~ INT:PBC
"
corrected <- relcorr_single_item(syntax = tpb_uk, data = TPB_UK)
print(corrected)
syntax <- corrected$syntax
data <- corrected$data
est_dca <- modsem(syntax, data = data, method = "dblcent")
est_lms <- modsem(syntax, data = data, method="lms", nodes=32)
summary(est_lms)
## End(Not run)