Plot utility PreviousNext
Mplus Discussion > Categorical Data Modeling >
Message/Author
 Daniel posted on Tuesday, May 11, 2004 - 10:20 am
A reviewer asked us to graph development in a LGM by class from our Latent Growth Class Analysis with an ordered categorical dependent variable. My question is, what is the best way to graph class differences in development in a single chart? Further, is it possible to add some kind of confidence intervals to a graph with your plot utility?
 Linda K. Muthen posted on Tuesday, May 11, 2004 - 2:01 pm
If you ask for PLOT3 in the PLOT command and use the SERIES option, you will get a choice of estimated probablities. All classes are plotted in the same plot. There is no option for adding confidence intervals.
 Anonymous posted on Tuesday, April 19, 2005 - 3:41 pm
Could you give me the correct syntax for PLOT when there is an s (slope) and q (quad) factor in a latent growth mixture model.
Is it?

PLOT:
TYPE IS PLOT2 PLOT3;
SERIES IS wjl54 - wjl5 (*) ;
OR

PLOT:
TYPE IS PLOT2 PLOT3;
SERIES IS wjl54 - wjl5 (s)| wjl54 - wjl5 (q) ;

Thanks in advance!!
 Linda K. Muthen posted on Wednesday, April 20, 2005 - 9:27 am
The correct syntax is:

PLOT:
TYPE IS PLOT3;
SERIES IS wjl54 - wjl5 (s) ;
 Salma Ayis posted on Friday, June 09, 2006 - 2:42 am
Please advice on how to obtain Item Characteristic Curves(ICC) plots for a set of of (binary)variables. I would like to have a plot for each variable as well as one for all in the same graph. Is that possible in Mplus?. I very much appreciate your anticipated assistance!.
 Linda K. Muthen posted on Friday, June 09, 2006 - 8:27 am
You can obtain Item Characteristic Curves and Influence Curves when you use maximum likelihood estimation by asking for PLOT2 in the PLOT command. You will then see them listed in the graphics menu.
 Salma Ayis posted on Saturday, June 10, 2006 - 11:12 am
Thanks very much!. I am afraid I need further assistance & hope you don't mind!. I am rather new to the IRT and this is the first time I intend to use it. Example 7.29 of the user's Guide seems fairly close to what I want: I have 10 binary variables, they are likely to form a construct and to classify subjects into clustes(latent classes). If my understanding is correct then example 7.29 will suit what I am trying to fit. I tried to run this example first to look at Item Characteristic Curves and start from there but I had few error messages such as:
*** WARNING in Variable command
Variable DZ, used in KNOWNCLASS specification, has been removed from the
USEVARIABLES list. Subsequent errors may occur if this variable is used
elsewhere.
*** ERROR
Variable names may only contain letters, digits, and the
underscore '_' character: LAM2-LAM4
*** ERROR
Label is not a valid parameter label. This label will not be
available for use in MODEL CONSTRAINT: LAM2-LAM4
*** ERROR
Variable names may only contain letters, digits, and the
underscore '_' character: LAM2-LAM4
__________________
__________________
I thought some files may have been corrupted after they were transfered or ..any thing like that. Have deleted the files and copied them from the Mplus home_page again, but had the same error!. Now I need your advice in:
1- am I right that example 7.29 have similar aims to my needs?
2- any help with the error messages please!.
I very much appreciate your time!
 Linda K. Muthen posted on Monday, June 12, 2006 - 6:35 am
Example 5.5 is an IRT example. I think this is what you should be looking at. The example you are looking at uses IRT but it is a specific twin model. From the error messages it sounds like you are not using Version 4 which introduced a list function for labels. If this is not the case, you need to send your input, data, output, and license number to support@statmodel.com.
 Myung Kim posted on Friday, April 09, 2010 - 11:31 pm
I'm working with a multilevel categorical model with a binary outcome. I'd like to plot the predicted probabilities (logistic curve) for a predictor in the model. When I use the command line, "Plot: TYPE=PLOT2;" no graph file is produced. When I use "Plot: TYPE=PLOT3;" a graph file is produced, but it is limited to scatterplots and histograms. Is there a way to produce a plot of the logistic curve for this model?

Thanks.

Myung
 Linda K. Muthen posted on Saturday, April 10, 2010 - 8:48 am
If you are using the SERIES option, then the plot is not available.
 Jon Elhai posted on Tuesday, July 06, 2010 - 5:12 pm
Linda,
I had previously in version 5 used the following syntax to produce a plot of my factors in a factor mixture model:
PLOT:
Type is plot3;
Series is F1 (1) F2 (2) F3 (3) F4 (4);

Where F1, F2, F3, and F4 are my factors - labeled just as they are in my model statement.

In version 6, when I try this, I see an error message that says:
"*** ERROR in PLOT command
Unknown variable in SERIES option: F1

So I'm wondering if the syntax for plot3 has changed in Version 6?
 Linda K. Muthen posted on Tuesday, July 06, 2010 - 5:27 pm
Please send the full output and your license number to support@statmodel.com.
 Tammy Kochel posted on Wednesday, November 10, 2010 - 11:40 am
I have run a SEM with a binary observed DV and WLSMV estimator. When I use Plot2 and view the probabilities for the DV relative to changes in the value of a specific IV "a", what value does it hold all of the other IVs "b" "c" etc to? My interpretation of the example in the Mplus manual led me to think they were held to a value of 1, but my hand-calculations against those produced by Mplus lead me to think otherwise. Will you please clarify the value Mplus assigns to the covariates for probability calculations in plot2?

Thank you.
 Linda K. Muthen posted on Wednesday, November 10, 2010 - 11:59 am
The mean of the covariate is used as the default.
 Tammy Kochel posted on Wednesday, November 10, 2010 - 12:23 pm
Thanks. When the covariates are binary, is the modal category used or the actual mean?
 Linda K. Muthen posted on Wednesday, November 10, 2010 - 12:58 pm
The actual mean is used as the default.
 Cecily Na posted on Wednesday, December 08, 2010 - 2:01 pm
Dear Linda,
Is there a function to get a model graph with path values and error variances? There is such a function in LISREL.
Could you tell me the command syntax?
Thanks!
 Linda K. Muthen posted on Wednesday, December 08, 2010 - 6:19 pm
No, Mplus does not create path diagrams.
 Scott R. Colwell posted on Tuesday, February 28, 2012 - 5:32 pm
I have 2 questions regarding the IRT Plots in PLOT 2 that I was hoping you could help me with.

1. Is it possible to change the scale on the y-axis (Probability) for an item characteristic curve so that it is in increments of 0.10 rather than 0.20?

2. When you chose the item characteristic curve plot, the fourth screen (for the set up) has the option to change the number of steps. I can't find this in the user manual, but is this just specifying what points on the line are being plotted? So choosing 1/100ths of a standard deviation would provide a much smoother plot?

Thanks
 Scott R. Colwell posted on Tuesday, February 28, 2012 - 5:33 pm
My mistake, I just found the answer to the 1st question. Just need to know about the second. Thanks,
 Bengt O. Muthen posted on Wednesday, February 29, 2012 - 8:45 am
2. Yes.
 burak aydin posted on Monday, June 04, 2012 - 1:07 pm
Hello
I know Mplus doesnt produce path diagrams. But can you tell me how did you draw ones in the User's Guide? Which software is it?
 Linda K. Muthen posted on Monday, June 04, 2012 - 2:02 pm
We use Freehand.
 Rich Jones posted on Tuesday, June 05, 2012 - 2:21 am
Hi Burak,

FWIW I've been using Smartdraw for many years. A long time ago it was an inexpensive alternative to Visio. Nowadays it is an expensive alternative to Visio.

Any other Smartdraw users out there want to join me in a project to develop a path diagramming library for Smartdraw, drop me a line.


Rich
jones@hsl.harvard.edu
 Rich Jones posted on Tuesday, June 05, 2012 - 2:27 am
Also,

We have developed some Stata code to transpose Mplus.out into graphviz code. It works pretty well, not pefectly. Right now better for on-the-fly path diagrams rather than final publication quality path diagrams.

Someone who knew what they were doing could probably take that Stata code and make it C, Java or Python pretty easily.

Drop a line if you're interested.

Rich
jones@hsl.harvard.edu
 Lisa M. Yarnell posted on Tuesday, February 04, 2014 - 11:25 pm
Hello,

I have run a a 2-group IRT model, and would like to generate ICCs for the two ethnic groups in the same plot (overlaying the ICC for one group with that for the other group--for the same item). Is that possible to do in Mplus?

One alternative could be to export the Mplus-generated ICCs with a transparent rather than white opaque background, and overlay the JPGs in an external program (Word or Paintbrush, etc.).

Is either of these possible? Thank you.
 Linda K. Muthen posted on Wednesday, February 05, 2014 - 2:23 pm
Neither option is available. You can save the data by using the Save Plot Data option under the Plot menu for each of the groups and then combine the data and plot this using another program like R or Excel.
 Lisa M. Yarnell posted on Wednesday, February 05, 2014 - 7:09 pm
Hi Linda, thank you. I am trying to do this, but the Save Plot Data option is currently grey rather than black, indicating that I cannot select this option.

Why would the Save Plot data option be grey for my OUT file, when I have requested PLOT3?
 Lisa M. Yarnell posted on Wednesday, February 05, 2014 - 7:19 pm
OK, I am seeing now that this is an option once I have generated the ICC graph. Then I can select Save Plot Data. Thank you.
 Pamela Allen posted on Tuesday, June 09, 2015 - 10:29 am
I am only able to plot one of the two desired lines in this plot using R with the .gh5 file associated with the model constraint below. R recognizes both loop labels, but I can only plot each line separately. What is the correct R command to display both lines?

Model constraint:

PLOT (fspred_UM fspred_UF);
LOOP(asdom3, 10, 40, 1);
fspred_UM= b0+(b1*asdom3);
fspred_UF= b0+c3+(b1*asdom3)+(b2*asdom3);
PLOT: TYPE=PLOT2;
 Andrew Ryan Flores posted on Wednesday, February 17, 2016 - 2:06 pm
Drs. Muthen - is it possible to change the confidence level for the plots in Mplus? I know the standard (and often most preferred) are 95% intervals.

This is specifically for the PLOT LOOP option.

If not, would you suggest the best option would be to MODEL CONSTRAINT over a series of representatives values, have MPLUS output CINVTERVAL, & make the figure myself?

Also, this would be a nice feature in future MPLUS packages.

Thanks,

Andrew
 Bengt O. Muthen posted on Wednesday, February 17, 2016 - 4:59 pm
Q1. No

Q2. Right.
 Susanne Frick posted on Wednesday, August 31, 2016 - 12:10 pm
Hello,

I have run a multidimensional IRT model in Mplus on a Mac and now I am trying to plot item information curves with the R package rhdf5. Unfortunately, I can only plot the first 3 items (out of 35). Do you know why this might be the case?

Thank you!
 Linda K. Muthen posted on Wednesday, August 31, 2016 - 2:14 pm
Please send the output and GH5 files and the mplus.R that you are using to support@statmodel.com.
 Daniel Hatch posted on Saturday, October 22, 2016 - 5:52 pm
Linda,

Quick question. My plot produces a straight horizontal line at y=0. Is there a way to suppress this?

Dan
 Daniel Hatch posted on Saturday, October 22, 2016 - 6:33 pm
One more question. If I format a plot (for instance, by taking out gridlines), is there a way to save those changes, such that I could come back to it to make additional changes without losing the original formatting changes?

Dan
 Bengt O. Muthen posted on Monday, October 24, 2016 - 10:05 am
Send the output and GH5 and the picture of the plot in question to support along with your license number.
 Daniel Hatch posted on Thursday, October 27, 2016 - 7:00 am
What do you mean by GH5?
 Bengt O. Muthen posted on Thursday, October 27, 2016 - 5:58 pm
When you use the PLOT command, Mplus produces both an output file and a .gh5 file. The .gh5 file has plot information in it. Look for it.
 Mindi posted on Monday, March 13, 2017 - 4:10 pm
I ran an LCA with a three class output. I am looking to plot all item probabilities (11) for the three classes on the same line plot. Does Mplus have this functionality?
 Bengt O. Muthen posted on Monday, March 13, 2017 - 6:13 pm
Yes. The plot is available as Estimated probabilities.
 AT Jothees posted on Wednesday, June 14, 2017 - 4:50 am
Hi,

I have a question related to plot 3 functions.

I have ten ordered categorical variables in LCA model. I would like to see the results in two separate graphs.

First one with five variables and second with other five variables.

Is it possible within same analysis ? or I have to run the analysis twice to get two separate plots.

Regards, Jo
 Bruno Chauvin posted on Friday, August 25, 2017 - 3:12 am
Hi,
Following the post by Daniel Hatch (october, 2016), I have a question related to the loop plot option. My loop plot automatically produces a straight horizontal line at y=0 as well as a straight vertical line at x=0. Is there a way to suppress them (like grid lines)?
Note: the associated .gh5 file is blank when I open it. There is no plot information in it.
Thank you
Bruno
 Bengt O. Muthen posted on Friday, August 25, 2017 - 4:41 pm
The grid lines can be suppressed by right-clicking on the plot and choosing Line plots.

Regarding the blank .gh5 file, send output and .gh5 file to Support along with your license number.
 dummyvariable123 posted on Sunday, November 26, 2017 - 9:53 am
Dear Dr. Muthen,
I am trying to create a line plot for my 2-2-1 indirect effect with confidence intervals (Type=PLOT3) and subsequently also a sensitivity plot (Type=PLOT3 SENSITIVITY).

Given that I have a mac, I tried to open the .gh5 file in a demo version on a pc but I was unable to view the graph (although the .gh5 file contained data). Is it not possible? Or should I specify the plot with the "view" command (how)?

I also tried to open the graph in R, but could not find an appropriate command. The command that I found referred only to the loop plots for moderated mediation. Is there a way to view a .gh5 plot for indirect effect with confidence intervals in R?
 Bengt O. Muthen posted on Sunday, November 26, 2017 - 4:40 pm
Send your output to Support along with your license number.

SENSITIVITY is not available for two-level modeling.
 Bengt O. Muthen posted on Sunday, November 26, 2017 - 4:41 pm
Also, the gh5 file needs to be read from output generated in an Mplus run in Windows.
 Daniel Stow posted on Tuesday, January 30, 2018 - 3:17 am
I'm trying to produce confidence intervals for trajectories identified in a three class latent growth mixture model with AUXILIARY = outcome (DCAT). I specified values for the parameters (from a model in the same data, with covariates). When I use the model constraint + plot/loop options for confidence intervals the model ignores the values I have specified. Can you produce plots with confidence intervals based on specified parameter values? Thank you

MODEL:
%OVERALL%
i s q|m0@0 m1@1 m2@2 m3@3 m4@4 m5@5 m6@6 m7@7 m8@8 m9@9 m10@10 m11@11 m12@12;

%c#1%
[i*myval s*myval q*myval] (p1-p3);
%c#2%
[i*myval s*myval q*-myval] (p4-p6);
%c#3%
[i*myval s*-myval q*myval] (p7-p9);

PLOT:
TYPE = PLOT2;
SERIES = m0-m12(s);

MODEL CONSTRAINT:
PLOT(class1 class2 class3);
LOOP(time,0,12,1);
class1 = p1+time*p2+time^2*p3;
class2 = p4+time*p5+time^2*p6;
class3 = p7+time*p8+time^2*p9;
 Bengt O. Muthen posted on Tuesday, January 30, 2018 - 5:40 pm
When you say e.g.

[i*myval s*myval q*myval] (p1-p3);

do you mean that these means should be fixed at certain values? If so, you should use @ instead of *.

If p1-p9 are fixed values, they don't have SEs and you don't have a basis for computing CIs - something needs to be stochastic for that.
 Chang Liu posted on Thursday, May 17, 2018 - 2:22 pm
Dear Dr. Muthen,

I am curious if the confidence intervals generated in the interaction plot (via PLOT LOOP, Plot 2) are prediction intervals or confidence intervals? Many thanks!
 Bengt O. Muthen posted on Thursday, May 17, 2018 - 4:41 pm
They are confidence intervals.
 Bonamy Oliver posted on Monday, July 15, 2019 - 1:47 am
Hi,

I have a multilevel model with interaction in Mplus (on a Mac). Two quick questions.
1. Is there a way to identify point(s) along the continuous moderator at which the association between IV and DV transitions from/to statistical significance? (I use Johnson-Neyman in non-MLM
2. I plot three simple slopes at different levels of the moderator using R from the GH5 file. However, once these three simple slope lines are on one plot, the confidence interval bands make the plot muddled. Is it possible to remove confidence intervals from the plot?
3. My Y-axis is labeled 'labels' is there a way to change this?
Thanks!
 Bengt O. Muthen posted on Tuesday, July 16, 2019 - 2:51 pm
Please send your data and output to Support so we can guide you regarding the plot issue.
 Youngshin Ju posted on Monday, June 08, 2020 - 9:12 pm
Hello,

I conducted MG-BSEM across many groups and I get various plots using "TYPE = PLOT2" option. In measurement parameters plots, I wonder how variant and invariant parameters are determined.

For example, I used prior setting for factor loadings: DO(1,7) DIFF(lam1_#-lam24_#) ~ N(0, 0.01). So, by what criteria are the variant/invariant parameters distinct?
Is it simply "variant item" if the variance of the parameter estimates across groups exceeds 0.01?

Thank a lot in advance!
 Bengt O. Muthen posted on Tuesday, June 09, 2020 - 1:03 pm
Have a look at this paper on our website:

Muthén, B. & Asparouhov, T. (2013). BSEM measurement invariance analysis. Mplus Web Notes: No. 17
 Anders Hofverberg posted on Wednesday, September 30, 2020 - 2:37 am
Hi,

I have conducted an LPA-analysis and I am interested in the relationship between class probabilites and several distal variables. I have used the DCON command together with the auxiliary syntax, and thus received the estimated means for the distal outcomes. However, I would also like to see plots for the estimated means of the distal variables for each class. Is that possible in Mplus? If so, how?

Thank you!
 Bengt O. Muthen posted on Wednesday, September 30, 2020 - 2:56 pm
We no longer recommend the DCON approach; see Table 8 of Web Note 21. You should use the BCH approach instead. Web Note 21 also shows how you can manually do BCH which is how you would be able to plot the class-specific means for the distal.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: