A Perl based parser for Mplus syntax

2 replies [Last post]
jssteele's picture
Joined: 10/11/2009

Version 0.3b available

Newest version 0.2b handles PON and PWITH syntax. 

I have attached a newer version of the .pm file. I would welcome suggestions if anyone has some. 

This is a work in progress and is in need of some more work currently. Use at your own risk... you have been warned. :)

====original message below====

Greetings again,

I have been working on double checking some models I am currently running in Mplus with OpenMx and have written some Perl code to handle conversion of "simple" Mplus syntax to OpenMx "RAM" paths... if anyone is interested. This requires Perl and the module HTML::Template to run. It also assumes that your data is in CSV format, and that you have an existing Mplus input script. I have attached the .pm (MplusParser.pm) file and an example script (Mplus2OpenMx_Example.pl).
From the command line you would run it as

$> perl Mplus2OpenMx_Example.pl Your_Mplus_Input.inp > Your_Mx_Output.txt

Where Your_Mplus_Input.inp & Your_Mx_Output.txt are whatever suits you. Open up the output file and double check, but things are running for me...

Let me know if you think it is useful. I will comment it more if anyone wants and I have time :).


P.S. Due to file extension restrictions on this forum I have changed the names to end in .txt. You will need to remove this prior to use.


Mplus2OpenMx_Example.pl_.txt230 bytes
MplusParser.pm_.txt27.21 KB
Jeff's picture
Joined: 07/31/2009
Joel, This is very exciting.


This is very exciting.  I've looked at the code but have yet to actually run it.  I'll let you know when I do.  Feel free to keep updating this forum as you update the code.  Also feel free to add to the wiki page that Tim created:




jssteele's picture
Joined: 10/11/2009
UPDATE Latest version is

UPDATE Latest version is attached to the original post. More comments and better handling of negative starting values on ranges.