Theta parametrization in Mplus vs Lavaan

460 views
Skip to first unread message

Tara P

unread,
Oct 28, 2022, 6:00:50 AM10/28/22
to lavaan
Dear all,

does the mimic="Mplus" code work for theta parametrization?
Background: my supervisor uses Mplus while I use lavaan. We often get different model parameters and df. For all maximum likelihood models, if I put mimic="mplus", I get the same parameters and dfs as he does. However, this was not the case for an analysis using WLSMV and theta parametrization.

Cheers,
Tara

Mauricio Garnier-Villarreal

unread,
Oct 28, 2022, 4:46:18 PM10/28/22
to lavaan
Tara

In the development of lavaan, the idea of replicating Mplus has been drop. As it is unclear what they do, and how to replicate some models. This is specially problematic with models with categorical indicators.

Also, thisw ay we can focus on adding features, instead of replicating a software that we dont particularly trust

So, in lavaan you can see what equations are being use and how they are use to estimate the model, completey see the code. Can Mplus say the same to you and your advisor?

In my experience, when I see differences I feel comfortable tructing what lavaan does, while I dont trust the black box of mplus

take care

Yves Rosseel

unread,
Oct 29, 2022, 4:42:33 AM10/29/22
to lav...@googlegroups.com
Hello Tara,

If the df are different, then you are not fitting the same models. In
that case, it is useful to compare the output of 'TECH1' in Mplus and
the output of lavInspect(fit) in lavaan. This information tells you
which parameters were free, and which were fixed. If this is identical
across programs, then at least the df should be identical.

Yves.

Tara P

unread,
Nov 3, 2022, 11:01:34 AM11/3/22
to lavaan
Thank you both! I have now figured out that there are two less free lambdas in my R-model (highlighted ones in the attached pic). How do I make them free?
Lavaan lambda.PNG

Mauricio Garnier-Villarreal

unread,
Nov 3, 2022, 7:33:00 PM11/3/22
to lavaan
Tara

can you share your lavaan syntax?

that should be done by adding the respective factor loadings, like

gastro =~ PQ01_01

Tara P

unread,
Nov 4, 2022, 3:40:23 AM11/4/22
to lavaan
This is my model:

bifactormodel <- '
  schmerz =~ PQ01_02 + PQ01_03+ PQ01_06
  kardio =~ PQ01_07 + PQ01_08 + PQ01_10 + PQ01_11
  gastro =~ PQ01_01 + PQ01_05 + PQ01_12 + PQ01_13
  fatigue =~ PQ02_01 + PQ02_02
  gsoma =~ PQ01_02 + PQ01_03+ PQ01_06 + PQ01_07 + PQ01_08 + PQ01_10 + PQ01_11 +
          PQ01_01 + PQ01_05 + PQ01_12 + PQ01_13+PQ02_01 + PQ02_02
  gsoma~~ 0*schmerz
  gsoma~~0*kardio
  gsoma ~~ 0 * gastro
  gsoma ~~ 0 * fatigue
  schmerz ~~ 0*kardio + 0*fatigue + 0*gastro
  kardio ~~ 0*fatigue + 0*gastro
  fatigue ~~ 0*gastro
  gsoma~~1*gsoma
  schmerz~~1*schmerz
  kardio~~1*kardio
  gastro~~1*gastro
  fatigue~~1*fatigue
'
fit_bifactor <- sem(model=bifactormodel, data=vars, estimator = "WLSMV", parameterization ="theta", mimic="mplus")

So the two missing free parameters are there....

Terrence Jorgensen

unread,
Nov 7, 2022, 5:05:31 AM11/7/22
to lavaan
All your first indicators are fixed to 1, which is the default in lavaan (and Mplus, whose results you want to mimic).  To instead fix latent variances to 1 for identification, set std.lv=TRUE so all loadings will be estimated.

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

Reply all
Reply to author
Forward
0 new messages