View source: R/estimate_cbsem.R
estimate_cbsem | R Documentation |
The seminr
package provides a natural syntax for researchers to describe
structural equation models.
estimate_cbsem(data, measurement_model = NULL,
structural_model = NULL, item_associations = NULL,
model = NULL, lavaan_model = NULL, estimator = "MLR", ...)
data |
A The entire CBSEM model can be specified in one of three ways: The pair of measurement and structural models, along associated items, can optionally be specified as separate model components |
measurement_model |
An optional |
structural_model |
An optional |
item_associations |
An item-to-item matrix representing error
covariances that are freed for estimation.
This matrix is created by The combination of measurement and structural models and inter-item associations can also be specified as a single |
model |
An optional The entire model can also be specified in Lavaan syntax (this overrides any other specifications) |
lavaan_model |
Optionally, a single character string containing the relevant model specification in Any further optional parameters to alter the estimation method: |
estimator |
A character string indicating which estimation method to use in Lavaan. It defaults to "MLR" for robust estimation. See the Lavaan documentation for other supported estimators. |
... |
Any other parameters to pass to |
A list of the estimated parameters for the CB-SEM model including:
data |
A matrix of the data upon which the model was estimated. |
measurement_model |
The SEMinR measurement model specification. |
factor_loadings |
The matrix of estimated factor loadings. |
associations |
A matrix of model variable associations. |
mmMatrix |
A Matrix of the measurement model relations. |
smMatrix |
A Matrix of the structural model relations. |
constructs |
A vector of the construct names. |
construct scores |
A matrix of the estimated construct scores for the CB-SEM model. |
item_weights |
A matrix of the estimated CFA item weights. |
lavaan_model |
The lavaan model syntax equivalent of the SEMinR model. |
lavaan_output |
The raw lavaan output generated after model estimation. |
Joreskog, K. G. (1973). A general method for estimating a linear structural equation system In: Goldberger AS, Duncan OD, editors. Structural Equation Models in the Social Sciences. New York: Seminar Press.
as.reflective
relationships
constructs
paths
associations
item_errors
mobi <- mobi
#seminr syntax for creating measurement model
mobi_mm <- constructs(
reflective("Image", multi_items("IMAG", 1:5)),
reflective("Quality", multi_items("PERQ", 1:7)),
reflective("Value", multi_items("PERV", 1:2)),
reflective("Satisfaction", multi_items("CUSA", 1:3)),
reflective("Complaints", single_item("CUSCO")),
reflective("Loyalty", multi_items("CUSL", 1:3))
)
#seminr syntax for freeing up item-item covariances
mobi_am <- associations(
item_errors(c("PERQ1", "PERQ2"), "IMAG1")
)
#seminr syntax for creating structural model
mobi_sm <- relationships(
paths(from = c("Image", "Quality"), to = c("Value", "Satisfaction")),
paths(from = c("Value", "Satisfaction"), to = c("Complaints", "Loyalty")),
paths(from = "Complaints", to = "Loyalty")
)
# Estimate model and get results
mobi_cbsem <- estimate_cbsem(mobi, mobi_mm, mobi_sm, mobi_am)
# Use or capture the summary object for more results and metrics
summary(mobi_cbsem)
cbsem_summary <- summary(mobi_cbsem)
cbsem_summary$descriptives$correlations$constructs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.