Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sam

Fit Structural Equation Models using the SAM approach


Description

Fit a Structural Equation Model (SEM) using the Structural After Measurement (SAM) approach.

Usage

sam(model = NULL, data = NULL, cmd = "sem", se = "twostep", 
    mm.list = NULL, mm.args = list(bounds = "standard", se = "standard"), 
    struc.args = list(estimator = "ML", se = "standard"), 
    sam.method = "local", ..., 
    local.options = list(M.method = "ML", veta.force.pd = TRUE, 
    twolevel.method = "h1"), global.options = list(), output = "lavaan")

Arguments

model

A description of the user-specified model. Typically, the model is described using the lavaan model syntax. See model.syntax for more information. Alternatively, a parameter table (eg. the output of the lavaanify() function) is also accepted.

data

A data frame containing the observed variables used in the model.

cmd

Character. Which command is used to run the sem models. The possible choices are "sem", "cfa" or "lavaan", determining how we deal with default options.

se

Character. The type of standard errors that are used in the final (structural) model. If "twostep" (the default), the standard errors take the estimation uncertainty of the first (measurement) stage into account. If "standard", this uncertainty is ignored, and we treat the measurement information as known. If "none", no standard errors are computed.

mm.list

List. Define the measurement blocks. Each element of the list should be either a single name of a latent variable, or a vector of latent variable names. If omitted, a separate measurement block is used for each latent variable.

mm.args

List. Optional arguments for the fitting function(s) of the measurement block(s) only. See lavOptions for a complete list.

struc.args

List. Optional arguments for the fitting function of the structural part only. See lavOptions for a complete list.

sam.method

Character. Can be set to "local" or "global".

...

Many more additional options can be defined, using 'name = value'. See lavOptions for a complete list. These options affect both the measurement blocks and the structural part.

local.options

List. Options specific for local SAM method (these options may change over time).

global.options

List. Options specific for global SAM method (not used for now).

output

Character. If "lavaan", a lavaan object returned. If "list", a list is returned with all the ingredients from the different stages.

Details

The sam function tries to automate the SAM approach, by first estimating the measurement part of the model, and then the structural part of the model. See reference for more details.

Value

If output = "lavaan", an object of class lavaan, for which several methods are available, including a summary method. If output = "list", a list.

References

Rosseel and Loh (2021). A structural-after-measurement (SAM) approach to SEM. URL https://osf.io/pekbm/.

See Also

Examples

## The industrialization and Political Democracy Example 
## Bollen (1989), page 332
model <- ' 
  # latent variable definitions
     ind60 =~ x1 + x2 + x3
     dem60 =~ y1 + a*y2 + b*y3 + c*y4
     dem65 =~ y5 + a*y6 + b*y7 + c*y8

  # regressions
    dem60 ~ ind60
    dem65 ~ ind60 + dem60

  # residual correlations
    y1 ~~ y5
    y2 ~~ y4 + y6
    y3 ~~ y7
    y4 ~~ y8
    y6 ~~ y8
'

fit.sam <- sam(model, data = PoliticalDemocracy,
               mm.list = list(ind = "ind60", dem = c("dem60", "dem65")))
summary(fit.sam)

lavaan

Latent Variable Analysis

v0.6-10
GPL (>= 2)
Authors
Yves Rosseel [aut, cre] (<https://orcid.org/0000-0002-4129-4477>), Terrence D. Jorgensen [aut] (<https://orcid.org/0000-0001-5111-6773>), Nicholas Rockwood [aut] (<https://orcid.org/0000-0001-5931-183X>), Daniel Oberski [ctb], Jarrett Byrnes [ctb], Leonard Vanbrabant [ctb], Victoria Savalei [ctb], Ed Merkle [ctb], Michael Hallquist [ctb], Mijke Rhemtulla [ctb], Myrsini Katsikatsou [ctb], Mariska Barendse [ctb], Florian Scharf [ctb], Han Du [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.