Comparing competing measurement models in Mplus is essential, but extracting fit indices and standardized factor loadings manually is time-consuming and error-prone.
Mplus2Excel is a lightweight utility that scans a folder of Mplus measurement model .out files, automatically:
- Aggregates fit indices across all competing models
- Produces a clean comparison table of measurement models
- Extracts STDYX standardized factor loadings
- Outputs the three best-fitting models for inspection and reporting
All results are written directly to a structured, publication-ready Excel workbook.
When run in a folder containing only Mplus measurement model output files, the tool will:
- Scan all
.outfiles in the folder - Extract key fit indices (e.g. χ², df, CFI, TLI, RMSEA, SRMR, AIC, BIC)
- Correlate all models into a single comparison table
- Rank models by fit
- Extract STDYX standardized factor loadings for the top 3 models
- Export everything to a single Excel workbook
This eliminates repetitive copy-paste work and reduces transcription errors.
The folder must contain only Mplus measurement model
.outfiles.
- Do not include structural models
- Do not include auxiliary analyses
- Do not mix different projects in the same folder
The script intentionally aggregates all detected output files into a single comparison table. Mixing analyses will contaminate results.
I built this tool after repeatedly wasting hours manually assembling model comparison tables and factor loading matrices for papers, reviews, and reports.
✅ Saves substantial time
✅ Eliminates transcription errors
✅ Produces consistent, reproducible tables
✅ Ideal for exploratory and confirmatory measurement work
✅ Designed for researchers who use Mplus heavily
- Download
mplus2excel.exefrom GitHub Releases - Place the EXE in the folder containing your Mplus
.outfiles - Double-click the EXE
- An Excel workbook and a
run.logfile will be created in the same folder
If something goes wrong, the log file can be shared for troubleshooting.
pip install -r requirements.txt
python mplus2excel.py --input "." --output "Competing_Measurement_Models.xlsx"
Optional arguments: --pattern "*.out" → restrict files --top 3 → number of best-fitting models to extract
Instructions tab (factor labels and mappings)
Table 1: Competing measurement model fit indices
Table 2: STDYX standardized factor loadings (top 3 models)
Audit tab: Parsed values for verification and transparency
💬 Open an Issue on GitHub
✉️ Contact me via my website psynalytics.com
This project was created by Prof. Llewellyn E. van Zyl .
- 🌍 Website: www.psynalytics.com
- 🔗 GitHub: @llewellynvz
🔥 If you’d like to contribute, feel free to fork this repo, submit a pull request, or report bugs!
This software is proprietary. Use and local modification are permitted for personal, academic, and internal research purposes only. Redistribution or commercial use is not permitted.
See the LICENSE file for details.
Star the repository ⭐
Share it with colleagues using Mplus
Contribute improvements or edge-case fixes