estimate_cbsem: seminr estimate_cbsem() function

View source: R/estimate_cbsem.R

estimate_cbsemR Documentation

seminr estimate_cbsem() function


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", ...)



A dataframe containing the indicator measurement data.

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


An optional measurement_model object representing the outer/measurement model, as generated by constructs. Note that only reflective constructs are supported for CBSEM models, though a composite measurement model can be converted into a reflective one using as.reflective.


An optional smMatrix object representing the inner/structural model, as generated by relationships.


An item-to-item matrix representing error covariances that are freed for estimation. This matrix is created by associations(), or defaults to NULL (no inter-item associations).

The combination of measurement and structural models and inter-item associations can also be specified as a single specified_model object Note that any given model components (measurement_model, structural_model, item_associations) will override components in the fully specified model


An optional specified_model object containing both the the outer/measurement and inner/structural models, along with any inter-item associations, as generated by specify_model.

The entire model can also be specified in Lavaan syntax (this overrides any other specifications)


Optionally, a single character string containing the relevant model specification in lavaan syntax.

Any further optional parameters to alter the estimation method:


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 lavaan::sem during estimation.


A list of the estimated parameters for the CB-SEM model including:


A matrix of the data upon which the model was estimated.


The SEMinR measurement model specification.


The matrix of estimated factor loadings.


A matrix of model variable associations.


A Matrix of the measurement model relations.


A Matrix of the structural model relations.


A vector of the construct names.

construct scores

A matrix of the estimated construct scores for the CB-SEM model.


A matrix of the estimated CFA item weights.


The lavaan model syntax equivalent of the SEMinR model.


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.

See Also

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

cbsem_summary <- summary(mobi_cbsem)

seminr documentation built on Oct. 13, 2022, 1:05 a.m.