Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Converting

20 views
Skip to first unread message

Alberto Cabrera

unread,
Nov 27, 2022, 1:05:21 PM11/27/22
to MplusAutomation
Dear Professor Hallquist,

I read with extreme interest your 2018 MplusAutomation: An R article. I am quite impressed by you and your co-author's effort in making Mplus accessible to a larger audience, while harnessing additional R capabilities.  While I am proficient with Mplus, I am just getting familiar with R. And, I need your help in running your first CFA example depicted on page 3. I am using  R studio 2022.07.2 Build 576 for OS.

After much trying I was able to figure it out how to convert the iris R dataframe into Mplus using the following R command:

MplusAutomation:: prepareMplusData[iris[ , 1:4], "iris.dat"]

What I have not been able to do is to create the R version of the Mplus file you provide on page 3. The page makes reference to using "syntax stud".

TITLE: Single Factor CFA;
DATA: FILE = “iris.dat”;
VARIABLE:NAMES = Sepal_Length Sepal_Width Petal_Length Petal_Width;
MISSING=.;
MODEL: F BY Sepal_Length Sepal_Width Petal_Length Petal_Width;
OUTPUT: CINTERVAL;

I would much appreciate it if you could provide the R syntax used in creating the CFA model.

In advance, many thanks

Alberto Cabrera

unread,
Nov 27, 2022, 2:31:34 PM11/27/22
to MplusAutomation
Please disregard this question. I figured it out the answer by creating an Mplus program.
Reply all
Reply to author
Forward
0 new messages