The Mplus GH5 File

The Mplus GH5 file was first introduced with Version 6.  It replaced the GPH file produced in previous Mplus versions which contained Mplus plot data.  The GH5 file contains Mplus plot data in HDF5 format.  The binary format helps to reduce the size of the file for analyses with a lot of plot data and increase the speed in reading in this plot data.

R functions are provided to assist users view plot and extract data from the GH5 file.  A more detailed explanation of the information stored in the GH5 file is also provided.

Updated July 1, 2013:  The Mplus R script has been updated to use the rhdf5 package from Bioconductor.  Some of the functions have been removed or renamed.  All remaining functions must be given the GH5 filename.  For more information about available functions in the rhdf5 package, visit the Biocondutor website at http://www.bioconductor.org/packages/release/bioc/html/rhdf5.html.  Use the following commands in R to install the rhdf5 package:

R> source("http://bioconductor.org/biocLite.R")

R> biocLite("rhdf5")

 

R Functions for Extracting and Plotting Data from an Mplus GH5 File

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

A.  Functions for viewing available plots

 

1.  mplus.view.plots

Description:       Reads the Mplus GH5 file and lists all available plots.

Usage:               mplus.view.plots('ex8.1.gh5')

 

B.  Functions for plotting data for the SERIES option.  Use these functions to get a quick view of available plots.

 

1.  mplus.plot.estimated_means

Description:       Plot the estimated means for the given series.

Usage:                  mplus.plot.estimated_means('ex8.1.gh5',process1')

Note:                    Use 'process1' to refer to the first series, 'process2' for the second series, etc.

 

2.  mplus.plot.sample_means

Description:       Plot the sample means for the given series.

Usage:                  mplus.plot.sample_means('ex8.1.gh5','process1')

Notes:                  See notes for mplus.plot.estimated_means.

 

3.  mplus.plot.sample_and_estimated_means

Description:       Plot the sample and estimated means for the given series.

Usage:                  mplus.plot.sample_and_estimated_means('ex8.1.gh5','process1')

Notes:                  See notes for mplus.plot.estimated_means.

 

4.  mplus.plot.estimated_probabilities

Description:       Plot estimated probabilities for the given series, summing up probabilities from category A to category B.

Usage:                  mplus.plot.estimated_probabilities('ex8.1.gh5','process1',A,B)

Notes:                  Values A and B are integers.  Use 'process1' for the first series, etc.

 

5.  mplus.plot.sample_proportions

Description:       Plot sample proportions for the given series, summing up the proportions from category A to category B.

Usage:                  mplus.plot.sample_proportions('ex8.1.gh5','process1',A,B)

Notes:                  See notes for mplus.plot.estimated_probabilities.

 

C.  Functions for getting plot data for the SERIES option.  Use these functions to get plot data only when more control of the plot characteristics are desired.

 

1.  mplus.get.estimated_means

Description:       Return the estimated means for the given series.

Usage:                  mplus.get.estimated_means('ex8.1.gh5','process1')

Notes:                  See notes for mplus.plot.estimated_means.

 

2.  mplus.get.sample_means

Description:       Return the sample means for the given series.

Usage:                  mplus.get.sample_means('ex8.1.gh5','process1')

Notes:                  See notes for mplus.plot.estimated_means.

 

3.  mplus.get.estimated_probabilities

Description:       Return the estimated probabilities for the given series, summing up probabilities from category A to category B.

Usage:                  mplus.get.estimated_probabilities('ex8.1.gh5','process1',A,B)

Notes:                  See notes for mplus.plot.estimated_probabilities.

 

4.  mplus.get.sample_proportions

Description:       Return the sample proportions for the given series, summing up proportions from category A to category B.

Usage:                  mplus.get.sample_proportions('ex8.1.gh5','process1',A,B)

Notes:                  See notes for mplus.plot.estimated_probabilities.

 

D.  Functions for getting and plotting individual data.

 

1.  mplus.list.variables

Description:       Get a list of the variable names for selection of individual data.

Usage:                  mplus.list.variables('ex8.1.gh5')

 

2.  mplus.plot.histogram

Description:       Plot the histogram for the given variable, using the specified number of bins.

Usage:                  mplus.plot.histogram('ex8.1.gh5','y1',5)

Note:                    If the number of bins is not given, the default of 10 bins will be used.

 

3.  mplus.plot.scatterplot

Description:       Plot the scatterplot for the 2 given variables.

Usage:                  mplus.plot.scatterplot('ex8.1.gh5','y1','y2')

 

4.  mplus.get.data

Description:       Get individual data for the given variable.

Usage:                  mplus.get.data('ex8.1.gh5','y1')