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;
MODEL: F BY Sepal_Length Sepal_Width Petal_Length Petal_Width;
I would much appreciate it if you could provide the R syntax used in creating the CFA model.
In advance, many thanks