Different results in Lavaan and MPlus

181 views
Skip to first unread message

Anna Parisi

unread,
Aug 29, 2021, 9:24:58 AM8/29/21
to lavaan
Hi all!

I am running a simple SEM in Lavaan, but am finding different results when I cross-check the model by running it in MPlus. I'm new to Lavaan, so I'm sure there's just something in my syntax I'm missing. The fit statistics are almost identical, but several IVs are significant in my Lavaan output that are not significant when I run in MPlus, which is a bummer. I'm wondering if anybody might be able to point me in the direction of why this discrepancy is there? 

LAVAAN

Pain <- '
PAIN =~ X1 + X2 + X3 + X4 + X5 + X6

Y1 ~ PAIN + X7 + X8 + X9
Y2 ~ PAIN + X7 + X8 + X10 

PAIN ~~ X7
PAIN ~~ X8 ' 

pain <- sem(pain, data = DATA, estimator = "WLSMV")
summary(pain, fit.measures=TRUE)

MPLUS

VARIABLE
NAMES ARE X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 Y1 Y2;
USEVARIABLES ARE X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 Y1 Y2;
CATEGORICAL ARE X1 X2 X3;
MISSING ARE (-9999);

ANALYSIS:
ESTIMATOR = WLSMV;

MODEL:
PAIN by X1 X2 X3 X4 X5 X6; 

Y1 on PAIN X7 X8 X9;
Y2 on PAIN X7 X8 X10 ;

PAIN with X7
PAIN with X8 

OUTPUT: Standardized Modindices;


Chesnut, Ryan

unread,
Aug 29, 2021, 9:45:09 AM8/29/21
to lav...@googlegroups.com
Try adding ordered=c(“x1”, “x2”, “x3”) after the estimator statement in the SEM function.

Sent from my iPad

On Aug 29, 2021, at 9:26 AM, Anna Parisi <abpa...@gmail.com> wrote:


--
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/CAObQ24Q7YsO9OmpgXTAM4F6bktzzBthhzsxknbGzEyf13kBggg%40mail.gmail.com.

Anna Parisi

unread,
Aug 29, 2021, 10:57:50 AM8/29/21
to lavaan
Oh my gosh, I can't believe I didn't catch that. My apologies for completely missing that I needed to specify my binary variables in lavaan and thank you so much for your help!




Reply all
Reply to author
Forward
0 new messages