July 21, 2018
Mplus at a Glance
General Description
Mplus Programs
Version History
System Requirements
Mplus Demo Version
Short Courses
Short Course Videos
and Handouts
Web Training
Mplus YouTube Channel
Mplus User's Guide
Mplus Diagrammer
Technical Appendices
Mplus Web Notes
User's Guide Examples
Mplus Book
Mplus Book Examples
Mplus Book Errata
Mplus Examples
Special Mplus Topics
Bayesian SEM (BSEM)
Complex Survey Data
Exploratory SEM (ESEM)
Measurement Invariance
Mediation Analysis
Missing Data
Mixture Modeling
Multilevel Modeling
Randomized Trials
Structural Equation Modeling
Survival Analysis
Time Series Analysis (DSEM)
Using Mplus via R
Mplus plotting using R
Chi-Square Difference
Test for MLM and MLR
Power Calculation
Monte Carlo Utility
Mplus Website Updates

Mplus Plotting Using R

The Mplus GH5 File and R Functions

Plots can now be created in R using information from most of the Mplus PLOT command options. While a limited number of R plots have been available and were mainly intended for Mac and Linux users, that list of plots has now been greatly expanded and is available for Mac, Linux, and Windows users. Mplus R functions read the Mplus GH5 file using the rhdf5 package from Bioconductor, thereby providing R with the necessary input data. While Mac and Linux users cannot get Mplus plots in the current Mplus version using the PLOT command, they can use the Mplus PLOT command to generate a GH5 file for use with an Mplus R function. The Mplus R functions provide basic R plots that the user can modify in R. The Mplus R Tutorial describes how to get started and lists the current Mplus R functions.

R and the RHDF5 Package

The R program is available from the CRAN website. In order to read the GH5 file created by Mplus, the rhdf5 package from Bioconductor must be loaded in R. The latest version of the rhdf5 package is version 2.14 and is compatible with R version 3.2.2 for Windows, Mac OS X and Linux operating systems.

Note that while the set of R functions has been written with users of Mplus Mac OS X and Linux versions in mind, the use of the GH5 file in R with the HDF5 package is not limited to these operating systems. Users of Mplus Windows can also load the GH5 file into R for Windows.

The File mplus.R

The file mplus.R contains the set of R functions to assist users view plots and extract plot data from the GH5 file created from an Mplus run. These functions can be loaded into R using the source command to load the mplus.R file.  A description of each function and its syntax are given in the Mplus R Tutorial.