Standard errors with categorical data from complex surveys

141 views
Skip to first unread message

R. Noah Padgett

unread,
Jun 5, 2023, 11:19:44 AM6/5/23
to lavaan
Hello all, 

I'm curious, how does lavaan compute standard errors for models when indicators are categorical, and one specifies a "cluster" variable and a "sampling.weights" variable? A few years ago I remember trying to use sampling weights in a model estimated with DWLS and lavaan would return a message or warning that this can't be done (at least I think so, I could be misremembering). However, when I tried again this week, I got a result. I'm unsure of what changed (if anything), and curious where I can find more information about this?

For example, running:
---
fit <- sem(
    mymodel, 
    data=mydata, 
    ordered=item.list, 
    cluster="COUNTRY", 
    sampling.weights="WGT"
)
summary(fit)
lavaan 0.6-13.1768 ended normally after 12 iterations

  Estimator                                       DWLS
  Optimization method                           NLMINB
  Number of model parameters                        32

  Number of observations                         66516
  Number of clusters [COUNTRY]                     142
  Number of missing patterns                         1
  Sampling weights variable                        WGT
...
Parameter Estimates:
  Standard errors                        Robust.cluster.sem
  Information                                      Expected
  Information saturated (h1) model             Unstructured

...
---

Additionally, what does the sampling weights variable do in this case? Is the  "Robust.cluster.sem" the same type of cluster robust used in Mplus?

Apologies for any duplicate questions from others. I know I've seen similar questions posted about sampling weights and categorical variables, but I couldn't quite find an answer. 

Thank you for any information and help with understanding what is being done!

- Noah

Terrence Jorgensen

unread,
Jun 12, 2023, 9:40:44 AM6/12/23
to lavaan
how does lavaan compute standard errors for models when indicators are categorical

It doesn't, but you can keep an eye on the feature request:


Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

R. Noah Padgett

unread,
Jun 12, 2023, 2:22:30 PM6/12/23
to lavaan
Thanks, Terrance!

joh4nd

unread,
Jun 12, 2023, 2:50:46 PM6/12/23
to lavaan
What is the consequence of the st. err. not being computed?

Stas Kolenikov

unread,
Jun 12, 2023, 2:59:12 PM6/12/23
to lav...@googlegroups.com
Just do this in Stata. Seriously. The right tool for the job.

Stata computes the standard errors from the first principles -- here are the ordinal observed variables, here are the parameters (regression links between latent variables and the observed variables +  thresholds), here is the likelihood (numeric integration over the latent variables), here are the likelihood scores computed numerically with respect to the parameters. You can compute the ("true") robust standard errors (not the fake Satorra-Bentler ones that assume the model structure is correct, pushing the standard errors down), you can compute cluster-corrected or survey-corrected standard errors by aggregating the scores over clusters. You don't get to compute the voodoo fit indices though. The two-step procedures employed in MPlus and lavaan (compute the polychoric correlations first; apply the SEM modeling to the correlation matrix) make it difficult to compute the standard errors.

-- Stas Kolenikov, PhD, PStat (ASA, SSC)  @StatStas 
-- Principal Statistician, NORC @NORCnews
-- Opinions stated in this email are mine only, and do not reflect the position of my employer
-- http://stas.kolenikov.name
 


--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/f2a274cf-2d2d-455a-9257-53318e61a529n%40googlegroups.com.

joh4nd

unread,
Jun 12, 2023, 3:29:20 PM6/12/23
to lavaan
Stas, what Stata command carries out the procedure you describe? Do you refer to gsem with ologit?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages