Skip to content

ESEM and LSAM: issue with SEs #487

@felipelfv

Description

@felipelfv

Hi Yves,

This issue follows from here: https://mail.google.com/mail/u/0/#inbox/FMfcgzQfBQKPgtMMbbtkXhVbfLvqjrJM

From my understanding, this does not appear to be a limitation imposed by the SE calculation on the LSAM. In principle, it should work, right? From debugging, we see a mismatch between the information matrix, the correction terms (i.e., H), and the cross-product of the latter. The mismatch seems to come from the rotation constraints.

library(lavaan); library(MASS)

set.seed(12345)
n <- 300

Sigma1 <- matrix(0.3, 9, 9)
diag(Sigma1) <- 1
Sigma1[1:3, 1:3] <- matrix(0.6, 3, 3); diag(Sigma1)[1:3] <- 1
Sigma1[4:6, 4:6] <- matrix(0.6, 3, 3); diag(Sigma1)[4:6] <- 1
Sigma1[7:9, 7:9] <- matrix(0.6, 3, 3); diag(Sigma1)[7:9] <- 1

Sigma2 <- matrix(0.5, 5, 5)
diag(Sigma2) <- 1

X <- mvrnorm(n, rep(0, 9), Sigma1)
Y <- mvrnorm(n, rep(0, 5), Sigma2)

sim_data <- data.frame(
  x1 = X[,1], x2 = X[,2], x3 = X[,3],
  x4 = X[,4], x5 = X[,5], x6 = X[,6],
  x7 = X[,7], x8 = X[,8], x9 = X[,9],
  y1 = Y[,1], y2 = Y[,2], y3 = Y[,3], y4 = Y[,4], y5 = Y[,5]
)

model_bug <- '
efa("block1")*f1 + efa("block1")*f2 + efa("block1")*f3 =~ 
  x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9

outcome =~ y1 + y2 + y3 + y4 + y5

outcome ~ f1 + f2 + f3
'

sam(model_bug, data = sim_data,
    mm.list = list(block1 = c("f1", "f2", "f3"), 
                   block2 = "outcome"),
    sam.method = "local", 
    rotation = "geomin")

sam(model_bug, data = sim_data,
    mm.list = list(block1 = c("f1", "f2", "f3"), 
                   block2 = "outcome"),
    sam.method = "global",
    rotation = "geomin")

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