Skip to content

Global SAM triggers local SAM SE error with categorical data #439

@RicardoReySaez

Description

@RicardoReySaez

Hi all,

I think I’ve found a small bug in the development version of lavaan (0.6-20.2351). When sam.method = "global" and ordered = TRUE for categorical observed variables, sam() returns the following error:

Error: lavaan->lav_sam_step1_local_jac():
IJ local SEs: not available for the categorical setting (yet)!

But this message seems to refer to local SAM, not global SAM, right? You can reproduce it with the R code below.

library(lavaan)

# Prepare dichotomic data
dat <- HolzingerSwineford1939[,7:15]
dat.dic <- apply(dat, 2, function(x) ifelse(x < mean(x), 0, 1))

# Holzinger and Swineford (1939) model
HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '

# Fit SAM model with global approach
fit <- sam(
  model = HS.model, 
  data = dat.dic, 
  ordered = TRUE, 
  mm.list = list(
    visual = "visual", 
    textual = "textual", 
    speed = "speed"), 
  sam.method = "global")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions