View source: R/outputUniConstructComp.R
outputUniConstructComp | R Documentation |
This function takes the outputted object from scrapeVarCross()
along with the corresponding dataset and automatically tests competing
uni-construct dyadic models for the latent variable under consideration.
It inspects four possible model variants:
Bifactor (scripted via dySEM::scriptBifac
)
Hierarchical (scripted via dySEM::scriptHier
)
Correlated Factors (scripted via dySEM::scriptCor
)
Unidimensional (scripted via dySEM::scriptUni
)
outputUniConstructComp(
dvn,
dat,
indexes = c("df", "chisq", "cfi", "rmsea", "bic", "GenTEFI"),
...,
gtTab = FALSE,
writeTo = NULL,
fileName = NULL
)
dvn |
Input dvn list from |
dat |
Input data frame containing the dataset for model estimation. |
indexes |
Input character vector specifying which index(es) to return.
Default is
|
... |
Additional arguments to be passed to |
gtTab |
A logical input indicating whether to generate the requested
index(es) for each fitted model (requested via the |
writeTo |
A character vector string specifying a directory path to where
the |
fileName |
A character string specifying a desired base name for the output
|
If "chisq" is included in indexes
, the specific form of the applied
chi-squared difference test (e.g., standard vs. robust) is determined
automatically by lavaan::lavTestLRT()
, based on the model estimation
method used.
If gtTab = TRUE
and writeTo
is specified, then output will simultaneously
be saved as a .rtf
file to the user's specified directory.
If output file is successfully saved, a confirmation message will be printed to the console.
If a file with the same name already exists in the user's chosen directory, it will be overwritten.
A list
containing up to two components:
Indexes
: A tibble::tibble()
if gtTab = FALSE
(default), or gt::gt()
object if gtTab = TRUE
, with the desired index(es) for each fitted model
(requested via the indexes
argument).
GenTEFI
: A tibble::tibble()
of the GenTEFI (if "GenTEFI" is included in
the indexes
argument).
dvn <- scrapeVarCross(
commitmentQ,
x_order = "spi",
x_stem = "sat.g",
x_delim1 = ".",
x_delim2="_",
distinguish_1="1",
distinguish_2="2"
)
outputUniConstructComp(
dvn,
commitmentQ,
missing = "fiml"
)
outputUniConstructComp(
dvn,
commitmentQ,
indexes = c("df", "bic"),
missing = "fiml"
)
outputUniConstructComp(
dvn,
commitmentQ,
indexes = c("df", "bic"),
estimator = "ml",
missing = "fiml"
)
outputUniConstructComp(
dvn,
commitmentQ,
indexes = c("df", "bic"),
missing = "fiml",
gtTab = TRUE,
writeTo = tempdir(),
fileName = "uni-construct-dyad-models"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.