Message/Author 


Hello, I am trying to run a multiple group analysis and test for differences between the groups (men & women). The model is comprised of all observed, continuous variables. I understand how to use the grouping function and constrain the paths (see syntax below). However I'm having trouble understanding the output. The approach I learned was to go step by step: First constrain path coefficients to be equal and test for differences. Then add on constraint for intercepts and test for differences. Then add on constrain for disturbances and test for differences. This way, you know where the difference lies. I'm confused what MPlus is doing with the syntax below and how to go about examining these differences. Any help would be much appreciated! MODEL: ib ON smsr (1) icsrle (2); cisst ON smsr (3); pswq rrs ON smsr (4) icsrle (5) ib (6) cisst (7) sxc (8); rrs WITH pswq (9); ANALYSIS: TYPE IS GENERAL; ESTIMATOR IS MLM; ITERATIONS = 1000; CONVERGENCE = 0.00005; OUTPUT: SAMPSTAT MODINDICES(3.84) RESIDUAL STANDARDIZED TECH2; 


See TECH1 or the results to see the effect of the equality constraints that you have placed. I think you may not mean some of them, for example, pswq rrs ON smsr (4) holds the regression coefficients of pswq on smsr and rrs on smsr equal to each other and equal across groups. To test the equality across groups, you can use chisquare difference testing of the model with constraints versus the model without constraints. You can also use the MODEL TEST command to obtain the Wald chisquare test. 


Thanks for your help. I am now trying to calculate the ChiSquare difference test using the SatorraBentler Scale ChiSquare. I have followed steps 14 using the following data and come up with a TRd = 21.68. What should I use for degrees of freedom to get the significance value? T0 = 32.561, C0 = 1.125, D0 = 27 T1 = 7.31, C1 = 0.986, D1 = 6 


The degrees of freedom is the difference in the number of free parameters. 


Hello, I am doing a CFA multigroup analysis for testing invariance (scalar). Mplus by default fixes the mean of the latent variable to 0 in the first group. The intercepts and loadings are equal across groups. I would like to use something different from the Mplus default. I am interested in the means of the latent variable. So, I fixed an intercept for one observed variable (tau)to 0 and I want to have all latent variable means free. I would like to know how to get a latent variable mean also in the first group? I hope my question is clear. An example is below: .... analysis: type= meanstructure; model: MEDIA by TV* RD* NWSP@1; TV* RD* NWSP* ; MEDIA* ; [TV* RD* NWSP@0] ; [MEDIA*]; model ES: TV* RD* NWSP*; MEDIA*; [MEDIA* ]; Thanks in advance, Lluís Coromina 


You have to free the mean in the first group. From what you show, I can't tell which is the first group. If you can't figure this out, please send the input, data, output, and your license number to support@statmodel.com. 


Hello, I'd like to use multigroup analysis to determine if moderation exists. I have a path model and would like to check for differences by subgroup. Can I run a multiple group model when my base unconstrained model is fully saturated? Thank you. 


If your path model is saturated in each group, you can test if a regression coefficient is different across groups. 


Hello, To confirm  is this via multiple group analysis, where I constrain the predictor path (and/or covariate paths)? And then compare the nonconstrained model and constrained model by analyzing the x2 and df? How, in this situation, would multiple group analysis differ from adding an interaction term? Would I arrive at the same conclusion of moderation or no moderation? Thank you. 


This is an alternative way of testing for an interaction where you use the DEFINE command to create the interaction variable. 

Anjali Gupta posted on Wednesday, September 02, 2009  11:15 am



Hello, Thank you for the response. To clarify  could using multiple groups analysis or interactions be 'interchanged'. That is, are there advantages/disadvantages to using either technique? Or times one should be used over the other? Also  to replicate running a regression on subgroups, say in SAS, would one, using Multiple Group Analysis, ideally constrain all paths (predictors, covariates, autoregressive paths)? Or focus on the predictor to Dep. Var path? It's my guess that to replicate regression models with subgroups  one would compare unconstrained versus all paths constrained  including the covariates. Thank you. 


Multiple group analysis allows more parameters to be compared. I am not familiar with SAS but I would imagine subgroups in SAS would be groups in Mplus. The constrained versus unconstrained models would be driven by the test you want to do. 

D C posted on Tuesday, August 03, 2010  5:35 pm



Hello, I am trying to do a twogroup CFA analysis with categorical indicators. Hence, I have to perform the difftest: ANALYSIS: type = mgroup; estimator = wlsmv; difftest is deriv.dat; I did this test by firstly estimating the less restrictive model (letting all loadings be free under 'MODEL group:' command with 'SAVEDATA: DIFFTEST IS deriv.dat;') then I estimated the more restrictive model (restricting equality of parameters under the 'MODEL:' command and 'ANALYSIS: difftest is deriv.dat;'). Hence, I got the following result indicating that constraining the parameters of the nested model significantly worsens the fit of the model: ChiSquare Test for Difference Testing Value 42.291 Degrees of Freedom 14** PValue 0.0001 However, I am afraid this result may still be driven by the large sample size of my data (group 1 N=2000 and group 2 N=1600). Are there other test I can use to show that the theorized factor structure fits the data well in both groups? Or, rather are there other tests to conclude that the loadings in the two groups are sufficiently similar to proceed with a full group analysis? Thank you! Dasha 


You might consider using an ESEM model as shown in Example 5.27. 

D C posted on Thursday, August 12, 2010  7:25 pm



Hello, Is it possible to free certain loadings across say, race, in a MIMIC model while regressing the latent factors on race? I would want to do this if the mentioned loadings actually fit statically significantly differently across race in a multigroup analysis. My second question: what does the direct regression effect from a factor indicator to race mean in a MIMIC model that also simultaneously regresses the latent factors on race? Thank you! 


The most straightforward way to see if factor loadings are different for race is to do a multiple group analysis. The regression of a factor indicator on a dummy variable is a direct effect and describes the intercept difference in the factor indicator across the levels of the dummy variable. See the Topic 1 course video and handout where MIMIC, multiple group, and measurement invariance are discussed in detail. 


Hello, Much like the first post in this thread, I am interested in running an MGA in a path model with all observed indicators. This a moderation model whereby the dichotomous groups are thought to moderate the direct effect of a predictor on 5 outcomes. I understand that individual or summary data can be used. Is it okay to use a correlation matrix if one chooses to use summary data? I am unclear if this is an appropriate strategy in that all variables except the moderator (in the model) are continuous. 


I would only use summary data when individuallevel data were not available. You can use a correlation is you have a scale free model and all continuous outcomes so that would be okay for your model. 


Thank you. Two further questions. If individual level data in our analyses are mean composite variables does this render the data as mean structure? Secondly, in testing the models at various levels of the moderator, we are interested only in a certain subset of paths that might differ as a function of moderator level. Thus, the overall chisquare test of model fit (which would test all paths in the model) would seem inappropriate. Is there a specific way to compare only a subset of paths in the model at a given level of the moderator? In both models (i.e., at both levels of the moderator) we will constrain these paths to equality for theoretical reasons. 


Meanstructure means that the means are estimated as model parameters. You can test nested models using chisquare or loglikelihood difference testing. 


Thanks Linda. One last question: it indicates in the user's guide that for summary data in the case of MGA that the first group is represented by the first set of summary data found in the summary data set. Thus, if we are opting to use a correlation matrix, would this mean then that the grouping variable (i.e., moderator) should appear as the first variable in a lower correlation matrix? 


There is no grouping variable with summary data. See the rest of the writeup where NOBOSERVATIONS and NGROUPS are explained. A correlation matrix is not allowed with multiple group analysis. A multiple group model is not a scale free model. 


Thanks. I did read the instructions for summary data and NOBSERVATIONS and NGROUPS after I initially posted. I am having trouble in that when I use my summary data file (a covariance matrix) and lay it out as is indicated with the covariances for g1 on top and g2 on the bottom, I get the warning that there are more NOBSERVATIONS than NGROUPS (NOBSERVATIONS being 138 and 387 respectively). Am I missing something? 


Please send the full output and your license number to support@statmodel.com. 


Hi: I did detect an error in my input file command statement that was responsible for the warning and was able to run the model successfully! 


Hello, Currently I am testing the effect of an intervention on (amongst others) the growth of problem behavior in MPLUS. Therefore I have tested latent growth curve models, and multiple group models. I have noticed that the latent growth curve models sometimes give bad results for the effect of the intervention on problem behavior, whereas multiple group models mostly lead to good results. Can I choose for multiple group models to represent my data, or am I bound to use latent growth modeling? Thank you for your response! 


PS: Maybe it is important to know that I have a relatively small sample size (89 persons in the treatment group, and 86 persons in the control gropu) 


I can't quite understand what you are doing. Please send the growth and multiple group outputs along with your license number to support@statmodel.com. 

Lily Wang posted on Monday, July 02, 2012  6:50 pm



Hi Drs. Muthen, I am working on a multi group analysis and have a question: I did two sets of analyses, one based on gender and the other on race and I found that a path is significant for both males and females in the gender based multigroup analysis, but not significant for either the white or the minority group in the race based multigroup analysis. This doesn't make intuitive sense, but maybe I miss something important here? Could you provide some guidance as to why this could happen? 


Sounds like you need to do a multigroup analysis with gender crossed with race groups. 

Lily Wang posted on Tuesday, July 03, 2012  6:46 am



Dr. Muthen, Thanks so much for your advice. Could I follow up on that and ask if you could provide any additional information on when to make such a decisione.g. instead of two sets of analyses respectively based on gender and race, running one analysis with four groups (white female, white male, minority female and minority male)? That is, only after the analyses and I see the weird pattern of that one path, or are there other considerations? Do you know of any references or examples that deal with similar problems? I really appreciate your time! 


Given the generality of the question, you might enjoy posing it on SEMNET. 


Hello, I want to measure differences/similarities between men's and women's behavior. My dataset does not allow me to run a group analysis. Instead of have a variable such as gender, it does have different variables for each item, e.g. X= husband hit by mother and Y= wife hit by mother. I ran exploratory and confirmatory analyses, independently, for men and women. The models are exactly the same. I am making my conclusions based on the correlations between four factors as well as their correlations with a few correlates (independent variables). All of the indicators of fit are excellent for both models (CTI, TLI, and RMSEA). Is this a legitimate way to compare these behaviors? Is there any way to run them in the same model? Thank you so much in advance, Esperanza 


Sorry another question. Could I use the 'test of model fit for the baseline model' from each model to claim difference between these populations? 


What is the unit of analysis in your data set. Is it couple? 


No. The individual. 


If the unit of observation is the individual, how can you have variables such as husband hit by mother and wife hit by mother? It seems the unit is either the husband or the wife. 

Sara Geven posted on Friday, September 27, 2013  12:23 am



Hello, I am conducting a multiple group analysis in which I am comparing paths across different groups. Because I am not interested in comparing (latent) means, I checked for metric invariance. In my structural model I now freely estimated the intercepts in each group. This seemed right to me, since I did not test for scalar invariance. Is this the correct approach? Kind regards, Sara 


This seems correct. 

Sara Geven posted on Sunday, September 29, 2013  9:57 am



Thanks a lot. It makes me feel more certain about my results. Sara 

baozhenzhou posted on Tuesday, February 25, 2014  1:27 am



Hello, I am trying to run a multiple group analysis and test for differences between two groups (male & female). The model is comprised of all observed, continuous variables(y is dependent variable,x is independent variable, w is moderator ). VARIABLE: names are y x w gender; grouping is gender (0 = female, 1 = male); usevariables are x y w gender xw; DEFINE: xw = x*w; ANALYSIS: bootstrap = 1000; MODEL: y on x w xw; MODEL male: y on x w xw; OUTPUT: STDYX CINTERVAL(BCBOOTSTRAP); The output only present the coefficients of the moderation for male and female.My question is how can i decide whether these moderation effects have gender differences? Thank you very much! 


You can use MODEL TEST or you can do a chisquare difference test between your model above and the model with regression coefficients held equal: MODEL: y on x (1) w xw; 

baozhenzhou posted on Tuesday, February 25, 2014  5:41 pm



Thanks, Linda! Follow your suggestions, I used Model Test. VARIABLE: names are y x w gender; grouping is gender (0 = female, 1 = male); usevariables are x y w gender xw; DEFINE: xw = x*w; ANALYSIS: bootstrap = 1000; MODEL female: y on x (fe_b1) w (fe_b2) xw (fe_b3); MODEL male: y on x (ma_b1) w (ma_b2) xw (ma_b3); MODET TEST: fe_b3=ma_b3; OUTPUT: STDYX CINTERVAL(BCBOOTSTRAP); I am interested in whether the moderation effect has gender difference, so I set the path of moderation to be equal and check the result of Wald test. Is it correct ? Thank you very much! 


MODEL TEST should be MODET TEST: 0 = fe_b3  ma_b3; Note that the parameters have different labels. They are not held equal. 


Hello, To use the Model Test option to test for invariance in a parameter across 4 groups, would Form A or Form B of the model statement below be correct? %overall% ia sa a1 a2 a3 a4 a5 a6 at t1t6; [ia]; %cg#1% [ia] (p1); %cg#2% [ia] (p2); %cg#3% [ia] (p3); %cg#4% [ia] (p4); !Form A model test: 0 = p1p2; 0 = p1p3; 0 = p1p4; !Form B model test: 0 = p1p2; 0 = p1p3; 0 = p1p4; 0 = p2p3; 0 = p2p4; 0 = p3p4; 


Form A is correct. 


Thank you Linda. I am a still confused as to why Form B would not be the test I would want to use. For example, Form A would tell me if P2, P3, and P4 were equal to P1, but not if P2 was equal to P3 and P4, or if P3 and P4 were equal. Is Form B not a more complete test of invariance across all four groups than Form A? 


MODEL TEST runs a joint test not individual tests. The tests from Form B that are not in Form A are implied by Form A. 

SY Khan posted on Wednesday, April 30, 2014  6:46 am



Hi Dr. Muthen, I am doing a path analysis with multigroup differnces for gender. I have specified two models i.e paths estimated freely (Model 1)and paths constrained (Model 2). Kindly advise if my syntax is correct: MODEL 1: grouping= gender (0 = female, 1 = male); MODEL: YA ON ABL MOT OPP COM; YD ON ABL MOT OPP COM; YJ ON ABL MOT OPP COM; YO ON ABL MOT OPP COM; J1 ON ABL MOT OPP COM; YA ON J1; YD ON J1; YJ ON J1; YO ON J1; MODEL 2: MODEL: YA ON ABL MOT OPP COM; YD ON ABL MOT OPP COM; YJ ON ABL MOT OPP COM; YO ON ABL MOT OPP COM; J1 ON ABL MOT OPP COM; YA ON J1; YD ON J1; YJ ON J1; YO ON J1; MODEL FEMALE: YA ON ABL MOT OPP COM (a); YD ON ABL MOT OPP COM (b); YJ ON ABL MOT OPP COM (c); YO ON ABL MOT OPP COM (d); J1 ON ABL MOT OPP COM (e); YA ON J1 (f); YD ON J1 (g); YJ ON J1 (h); YO ON J1(i); MODEL MALE: YA ON ABL MOT OPP COM (a); YD ON ABL MOT OPP COM (b); YJ ON ABL MOT OPP COM (c); YO ON ABL MOT OPP COM (d); J1 ON ABL MOT OPP COM (e); YA ON J1 (f); YD ON J1 (g); YJ ON J1 (h); YO ON J1(i); Many thanks. 


The best way to tell if a syntax is correct is to run the analysis and look at your results. The following statement holds all four regression coefficients equal to each other. Is that what you want? YA ON ABL MOT OPP COM (a); 

SY Khan posted on Wednesday, April 30, 2014  9:18 am



Dr. Muthen thank you for the prompt reply. I realized as well that holding the four regression coefficient is not what I intended.So modified the syntax as follows: YA ON ABL (a); YA ON MOT(b); YA ON OPP (c); YA ON COM(d); and the rest of the syntax is changed accordingly as well for both FEMALE and MALE Models. When I run the analysis I get the following Results: UNCONSTRAINED MODEL: ChiSq(0)= 0.000 RMSEA= 0.000 CFI=1.000 TLI=1.000 CONSTRAINED: (ALL SIMILAR PATHS held Equal) ChiSq(24)=146.423 pvalue=0.0000 RMSEA=0.023 CFI=0.991 TLI=0.972 Do these model fit results mean that gender does not have an effect on the regression relationships? I am not sure how to interpret these results. Some of the insignificant regression results in the unconstrained model become significant in the constrained model and vice versa. But most stay the same. Thanks. 


The question you answer when you compare a model where the regression coefficients are free across groups to the model where the regression coefficients are equal across groups is whether holding them equal worsens model fit. If the chisquare difference is significant, it indicates that constraining the parameters to be equal worsens the fit of the model. This means they are not the same for males and females. 


Hi I am having an error message (using v 5.2) with this syntax and have checked the variable, *** ERROR Categorical variable ET10 contains less than 2 categories. ET10 does have more than 2 categories. What am I doing wrong? Thanks Angela IDVARIABLE IS ID; MISSING ARE ALL (99); USEVARIABLES ARE ET1 ET2 ET3 ET4 ET5 ET6 ET7 ET8 ET9 ET10 ET11 ET12 ET13 ET14 REL1 REL2 REL3 REL4 REL5 REL6 REL7 ENV1 ENV2 ENV3 ENV4 ENV5 ENV6 CLX1 CLX2 CLX3 CLX4 PRAC1 PRAC2 PRAC3 PRAC4 PRAC5 PRAC6 LS1 LS2 LS3 LS4 LS5 Level; CATEGORICAL ARE ET1 ET2 ET3 ET4 ET5 ET6 ET7 ET8 ET9 ET10 ET11 ET12 ET13 ET14 REL1 REL2 REL3 REL4 REL5 REL6 REL7 ENV1 ENV2 ENV3 ENV4 ENV5 ENV6 CLX1 CLX2 CLX3 CLX4 PRAC1 PRAC2 PRAC3 PRAC4 PRAC5 PRAC6 LS1 LS2 LS3 LS4 LS5; GROUPING IS Level (1=L1 2=L2 3=L3 4=L4); ANALYSIS: ESTIMATOR = WLSMV; MODEL: FAC1 BY ET1 ET2 ET3 ET4 ET5 ET6 ET7 ET8 ET9 ET10 ET11 ET12 ET13 ET14 REL1 REL2 REL3 REL4 REL5 REL6 REL7 ENV1 ENV2 ENV3 ENV4 ENV5 ENV6 CLX1 CLX2 CLX3 CLX4 PRAC1 PRAC2 PRAC3 PRAC4 PRAC5 PRAC6 LS1 LS2 LS3 LS4 LS5; MODEL L1: FAC1 BY ET1 ET2 ET3 ET4 ET5 ET6 ET7 ET8 ET9 ET11 ET12 ET13 ET14 REL1 REL2 REL3 REL4 REL5 REL6 REL7 ENV1 ENV2 ENV3 ENV4 ENV5 ENV6 CLX1 CLX2 CLX3 CLX4 PRAC1 PRAC2 PRAC3 PRAC4 PRAC5 PRAC6 LS1 LS2 LS3 LS4 LS5; 


Please send the output, data set, and your license number to support@statmodel.com. 


Hello, I'm attempting a two group mean comparison with a sample of 9,932. I have 23 variables and am using 6 of those as Usevariables. I am receiving the error message: Data file contains more data than necessary. Data contents may be incorrectly supplied. The data works fine for a path analysis. This is my first time conducting a means difference on a path analysis so I may be doing something completely wrong. I've spend a long time searching before asking, but can't find an answer. Any help is greatly appreciated. 


Please send output and data to support so you don't have to keep searching. 

Jon H posted on Thursday, February 26, 2015  9:22 am



I am wondering if there is a way to use multiple group analysis (or something similar) to look at nested models with a lot of constraints. For example, let's say I'm looking at the following code for a composite variable (Model 1): f1 by x1(a1) x2(a2) x3(a3); f2 by x4(a4) x5(a5) x6(a6) f3 by x7(a7) x8(a8) x9(a9) fy1 by y1(b1) y2(b2) y3(b3); c1 by; c1 on f1@1 f2(q2) f3(q3); fy1 on c1; And then for Model 2, I'm looking at: f1 by x1(a1) x2(a2) x3(a3); f2 by x4(a4) x5(a5) x6(a6) f3 by x7(a7) x8(a8) x9(a9) fy1 by y1(b1) y2(b2) y3(b3); c1 by; c1 on f1@1 f2(q2) f3(q3); fy1 on c1; fy1 on c1 race sex income; What I'm looking for is a way to constrain many of these paths to be the same from model 1 to model 2, as indicted by the labels above. I'm trying to figure out what happens to the relationship between fy1 and c1 if I introduce a bunch of additional covariates, but otherwise everything else remains the same. My understanding is constraining variables across models only works in multiple group analysis, but I can't see how it would work. Can you think of a way to do this in Mplus? 


Mutiplegroup won't do it since it is the same people. It sounds somewhat akin to 3step. I guess you don't simply want to fix the equal parameters when you go to Model 2. No bright ideas come to mind. 

Luo Wenshu posted on Wednesday, March 25, 2015  11:47 pm



Dear Dr. Muthen, In twogroup CFA analysis, if there is evidence to show 1) metric and scalar equivalence 2) equivalence of factor variance & covariance matrix 3) but nonequivalence of indicator residual variances, can we then combine the two groups to run full SEM to examine structural relationships among factors? Thank you very much! 


I would not combine the groups into a singlegroup analysis because it may distort the estimates relative to a twogroup analysis. I would just continue the twogroup analysis under scalar invariance. See also my 1989 Psychometrika article "Heterogeneous...". 

YH, Son posted on Thursday, November 26, 2015  3:16 am



Dear Dr. Muthen, In twogroup LGM, i want to check the difference between growth factors. I S1 a1@0 a2@1 a3@2 a4@3 a5@4; I S2 a1@0 a2@0 a3@1 a4@1 a5@1; s1@0;(because of only two time point) I know i can't test the difference of s1 variance becasue s1 fixed to 0. But, I want to test the difference of s1 "means" between two groups. Model a: [s1] (a_s1); MODEL B: [S1] (B_S1); MODEL TEST: A_S1 B_S1 BUT, WARNING SAYS " All continuous latent variable covariances involving S2 have been fixed to 0 because the variance of S2 is fixed at 0.". CAN'T I test the differec of means? 


It is s2@0 that is needed. You can test the s2 means. That message is just a warning not an error. But you should write Model Test: 0 = A_s1  B_s1; 

Irene Dias posted on Friday, April 01, 2016  12:34 pm



Dear Dr Muthen, I am using multigroup analysis to test if mediation exists (all variables in the model are observed). The unconstrained model is fully saturated and I am trying to test if differences in the regression paths exist between students in grade 4 and in grade 8, but I am working with a longitudinal design, meaning that the group of students is the same but assessed in both grades. Can I use multigroup analysis and use the define command to test for differences? Given that all variables are observed and the model fully saturated, but I have a longitudinal design, should I use the command type=meanstructure? Should I control in any way for the covariance of the scores, given that they have been measured in the same participants? Thank you so much. 


If the grade 4 students are the same as the grade 8 students you can't use multigroup analysis because it assumes independent observations. Instead, formulate a model for both grades (wide format) and how the variables relate across grades and then use Model Test or Model constraint to check for differences of any parameters or product of parameters that you wish. 

Back to top 