Constraints PreviousNext
Mplus Discussion > Structural Equation Modeling >
 Anonymous posted on Thursday, December 09, 2004 - 4:49 pm
Hello, I am a rather new Mplus user. I am performing an SEM where I need to free covariances between some observed variables. How do I do this with Mplus? I haven't been able to find a solution in the user's guide. Thanks
 bmuthen posted on Thursday, December 09, 2004 - 5:18 pm
Look up the WITH command in the user's guide and you will find the answer.
 Anonymous posted on Friday, December 10, 2004 - 5:51 am
Thank you! It works perfect and much easier than Lisrel or EQS.
 Jakob Bjorner posted on Tuesday, May 17, 2005 - 5:45 am
Is there a trick where you can constrain a parameter to be positive, but not specify further restrictions? I tried to work with the model constraint option in the model statement, but could not make it work
 Linda K. Muthen posted on Tuesday, May 17, 2005 - 9:07 am
This is Tihomir's trick. The important thing is not to introduce a new parameter in the model. The exp function insures that the parameter is postive.

In a factor model, let parameter p2 be the one to be positive:

f by y1
y2 (p2);
!create a dummy parameter p1 (any one will do):
fdum by y1@0;
fdum (p1);

Model Constraint:
p2 = exp (p1);
 Arjen Noordhof posted on Monday, January 23, 2006 - 2:46 am
I'm trying to use this trick, but I encounter some problems I could not find solutions for in the discussions. I need to constrain several parameters to be positive and others to be negative. Does this mean I have to create a dummy-variabel for every constraint? If I do so, MPlus returns an error "negative degrees of freedom". In fact due to the dummy-variables the number of latent variables is larger than number of observed variables. Haven't I understood the trick well? Is their a way to solve this problem?
 arjen noordhof posted on Monday, January 23, 2006 - 3:25 am
If I decrease the number of dummies I still get an error (PSI-matrix not positive definite) involving the first dummy-parameter. Standard errors cannot be estimated.
 Linda K. Muthen posted on Monday, January 23, 2006 - 8:52 am
You can try adding fdum WITH f@0; to the MODEL command. If this does not work, send your input, data, output, and license number to

For negative, use -EXP.
 Joseph A. Olsen posted on Tuesday, October 03, 2006 - 7:51 am
In Mplus, is there a way to contrain the variance of an endogenous latent variable to be equal to a specific numeric value, or to equal the variance of another endogenous latent variable (as in Ramona or Sepath)?
 Linda K. Muthen posted on Tuesday, October 03, 2006 - 10:10 am
Yes, you can do this using MODEL CONSTRAINT. See the Mplus User's Guide which is on the website for a full description.
 Joseph A. Olsen posted on Tuesday, October 03, 2006 - 10:58 am
I can see how to constrain the variance of an endogenous latent variable's disturbance, but would like to place the constraint on the "whole" variance of the latent variable, not just its disturbance.
 Bengt O. Muthen posted on Tuesday, October 03, 2006 - 2:34 pm
You use Model constraint to express the whole variance as a function of the parameter estimates, for example using the "NEW" parameter feature, and then use that in constraints.
 John Hipp posted on Wednesday, September 03, 2008 - 6:07 pm
I'm trying to constrain the variance of the disturbance of a single indicator to a specific value based on a reliability score. I'm trying to do this with your nonlinear constraints (as I'm going to estimate a more complicated model where I cannot just set it to a specific value). I'm using this code:

!variance of the indicator error terms;

!variance of latent variable;

ptbl06 BY psblk06@1;
ptlat06 BY pshisp06@1;

ptbl06 WITH ptlat06;

.823 = p3/(p3+p1);
.503 = p4/(p4+p2);

But something's going wrong in that it's constraining the variance of the latent variables to zero. Can you tell me where I'm going wrong?
 Linda K. Muthen posted on Thursday, September 04, 2008 - 6:57 am
Please send the input, data, output,and your license number to
 Scott R. Colwell posted on Wednesday, December 09, 2009 - 10:47 am
Within the Model Constraint Command, is there a way to specify BY and ON statements?
 Linda K. Muthen posted on Wednesday, December 09, 2009 - 5:28 pm
No, linear and non-linear constraints can be defined using the equal sign (=), the greater than sign (>), the less than sign (<), and all arithmetic operators and functions that are available in the DEFINE command with the exception of the absolute value function.
 Don J.Q. Chen posted on Friday, April 02, 2010 - 2:06 am
When I tried to constrain error variance to SD^2 x (1-alpha) and latent to indicator path to sqrt(1-[SD^2 x (1-alpha)]. I receive an error message that PSI-matrix not positive definite.

Subsequently, I tried the Tihomir's trick as recommended but I receive an error message informing me that A parameter label or the constant 0 must appear on the left-hand side of a MODEL CONSTRAINT statement.

How should I go about resolving this issue? Thanks!
 Linda K. Muthen posted on Friday, April 02, 2010 - 6:39 am
Please send the full output and your license number to
 Novice Researcher posted on Thursday, May 06, 2010 - 2:19 pm
I used the Model Constraint Command for significance testing. In the Savedata section, I saved the results of the analysis in a text file. In the Mplus output I can see results for the New/Additional Parameters. However when I try to find them in the text file, I don't see them nor are they listed in the Order of data at the end of the Mplus output.

Are the Model Constraint results saved with the other estimates in the text file. If so where would I find them? If not, how can I save them?
 Linda K. Muthen posted on Thursday, May 06, 2010 - 3:43 pm
We do now save the NEW parameters using the RESULTS option of the SAVEDATA command. Please send your output and license number to if you can't see this.
 Matt C posted on Friday, May 07, 2010 - 5:16 pm

I'm still familiarizing myself with doing constraints in Mplus, so I apologize for the rudimentary question.

I'm running an LGM using four indicators modeled with latent intercept, linear, and quadratic parameters. Results suggested that the covariance between the intercept and linear slope terms was non-significant; thus, I initially attempted to constrain it to zero as below:


MODEL: i s q | perf1@0 perf@1 perf3@2 perf4@3;
s WITH i (p1);
p1 = 0;


Running that was giving me troubles (I was getting results indicating that parameter SEs could not be estimated because the model may not be identified). I later tried running it as below, which did work as intended. My question: what is it that the syntax above is doing that is different from that shown below? Thank you greatly for any information!


MODEL: i s q | gpa1@0 gpa2@1 gpa3@2 gpa4@3;
s WITH i@0;
! p1 = 0;

 Linda K. Muthen posted on Saturday, May 08, 2010 - 7:40 am
I have tried the two versions of fixing i WITH s at one and have no problem. I see that you have different outcomes. For further information, send your outputs and license number to
 Novice Researcher posted on Saturday, May 08, 2010 - 10:45 am
"We do now save the NEW parameters using the RESULTS option of the SAVEDATA command."

I was using an older Mplus version. Is this feature only available in the new Mplus V6 release?
 Linda K. Muthen posted on Saturday, May 08, 2010 - 11:10 am
I am not sure when we started doing this. I don't believe it is new in Version 6.
 Anna  posted on Friday, June 25, 2010 - 2:12 am
Hello, I am using the model constraint command in order to constrain the correlations between the slopes and the levels of two latent variables in a latent growth model to be equal rahter than constraining the covariances to be equal. However, in the output, the correlations are not equal but i did not get any error message either. Do you know where I went wrong?
Thank you very much for your answer!!
 Linda K. Muthen posted on Friday, June 25, 2010 - 6:06 am
Please send your full output and your license number to
 Paul R. Hernandez posted on Tuesday, September 14, 2010 - 1:41 pm
Dear Linda,

I'm trying to understand how Mplus is calculating the standard error of a model constraint. I have a model constraint wherein I am contrasting two correlated parameters estimates. For example:

Model Constraint:
New(diff_B1B2) .
diff_B1B2 = B1 - B2 .

Is Mplus calculating the SE as Variance(B1)+Variance(B2)-2*Covariance(B1B2)?

 Linda K. Muthen posted on Tuesday, September 14, 2010 - 2:10 pm
Mplus uses the Delta method which in the case of a linear function of random variables is the expression you give. See page 247 of Kendall and Stuart, The Advanced Theory of Statistics, Volume 1, Fourth Edition.
 Paul R. Hernandez posted on Wednesday, September 15, 2010 - 7:37 am
Thank you!
 Sanja Franic posted on Monday, November 21, 2011 - 12:50 am
Hi, I have the following constraint in my script:


but it appears to be too long to fit in one line. I thought I'd try something like


but that does not work as I need to have a parameter label or a 0 on the left-hand side. Is there a trick to do this?
 Sanja Franic posted on Monday, November 21, 2011 - 1:00 am
Ok, got it. I did:

xx by x1@0;
xx*.2 (tr);


 Bengt O. Muthen posted on Monday, November 21, 2011 - 7:38 am
You can also let your expression continue over several lines - you don't need to have a semi colon on each line.
 Sanja Franic posted on Monday, November 21, 2011 - 9:40 am
 Lisa M. Yarnell posted on Monday, December 05, 2011 - 6:42 pm
Is there any difference between alpha constraints--for example, (p1)--and numeric constraints--for example, (1)?

When would a user want to use alpha (letter) constraints as opposed to numbers? Is it just that the alpha constraints allow for more complex mathematical statements to be written in the MODEL CONSTRAINT section? Is it correct that other than this, there is no difference?
 Linda K. Muthen posted on Monday, December 05, 2011 - 6:55 pm
There is no difference.
 jas229 posted on Tuesday, July 10, 2012 - 12:55 pm
Dear Prof Muthen,
We are trying to test a model with causal stress indicators to study the effect of a latent stress variable on two outcomes (negative and positive affect). In order to do this, we were hoping to follow Bollen & Davis's (2009) suggestion for testing underidentified models by using proportionality constraints. We need to include direct pathways between the causal indicators and the outcome variables and then impose proportionality constraints on these paths that assume that the influence of the causal indicators is mediated through a casual latent variable. We tried imposing these constraints using the model constraints command by naming the proportions between the paths that need to be constrained and then equating them to be equal. However, we get this error:


Could you please guide us about the syntax we need to impose these constraints in order to run the model?

Thank you,

 Linda K. Muthen posted on Tuesday, July 10, 2012 - 1:11 pm
Please send your output and license number to
 Francisca Galindo Garre posted on Friday, September 07, 2012 - 5:59 am
Dear prof Muthen,

Recently I read the paper by van de Schoot et al (2010) on Testing Inequality Constrained Hypotheses and I am interested in the procedure implemented in MPLUS to estimate models with inequality constrained parameters. I have already used it, but I would like to know more about how it works. The procedure is briefly described in van de Schoot et al, and I am wondering if you have a paper or technical report that described this procedure with more detail.

Thank you very mush for your help.

Best regards,

 Rens van de Schoot posted on Friday, September 07, 2012 - 7:17 am
Dear Fransisca,

There are two ways of testing for inequality constraints in Mplus: (1) using bootstrapping and (2) using Bayes Factors.

There are two publications describing the procedure for (1):

- Van de Schoot, R., Hoijtink, H. & Dekovi&#263;, M. (2010). Testing Inequality Constrained Hypotheses in SEM Models. Structural Equation Modeling, 17, 443463.
- Van de Schoot, R. & Strohmeier, D. (2011). Testing informative hypotheses in SEM Increases Power: An illustration contrasting classical hypothesis testing with a parametric bootstrap approach. International Journal of Behavioral Development, 35: 180-190

Two papers describing the second method are in press:

- Van de Schoot, R., Hoijtink, H., Hallquist, M. N., &Boelen, P.A. Bayesian Evaluation of inequality-constrained Hypotheses in SEM Models using Mplus. Structural Equation Modeling.
- Van de Schoot, R., Vehoeven, M., & Hoijtink, H. Bayesian Evaluation of Informative Hypotheses in SEM using Mplus: A Black Bear story. European Journal of Developmental Psychology.

If you want a copy of these papers please send me an email and I will be happy to give you a copy of both papers.

Best regards,
Rens van de Schoot
 Lisa M. Yarnell posted on Thursday, April 18, 2013 - 6:09 pm

Can I impose a constraint using MODEL CONSTRAINT that maximizes a correlation between two factors in the model?

(I see other constraints, such as that a parameter be less than or greater than a certain value. So perhaps there is a way to constrain the paramater such that the correlation is maximized?)

 Linda K. Muthen posted on Thursday, April 18, 2013 - 8:18 pm
This is not a function in MODEL CONSTRAINT.
 Steve posted on Wednesday, June 26, 2013 - 9:37 am

I am a relatively new user to Mplus.

Basically - I need to know how to constain the correlation between two latent variables to 1.

That is, I am needing to conduct a Chi-square difference test using a CFA of two latent variables F1 and F2. Model 1 with the correlation between F1 and F2 freely estimated vs Model 2 with the correlation between F1 and F2 set to 1 (with a 1 df change).

Model 1 works fine

F1 by X1 X2 X3;
F2 by X4 X5 X6;

For Model 2, I am using

F1 by X1 X2 X3;
F2 by X4 X5 X6;
F1 with F2@1;

However, the output for Model 2 does not provide model fit nor STDYX statistics.

Many thanks.
 Bengt O. Muthen posted on Wednesday, June 26, 2013 - 1:12 pm
Why do you need STDYX for Model 2 - aren't you just interested in the test result?

Note also that F1 WTIH F2 is not a correlation, but a covariance given that the factor variances are not 1. To make into a correlation you have to fix the metric by fixing the factor variance at 1 instead of the default of the first loading at 1.

Btw, you can get your test by running only Model 1 and using Model Test to see if the correlation = 1.
 Steve posted on Wednesday, June 26, 2013 - 1:35 pm
Dear Bengt,

Thank you for your quick response.

Yes, I don't need STDYX - just noticed it was not there for comparison and to check that correlation between F1 and F2 was in fact 1. If I understand correctly, I should use:

F1 by X1* X2 X3;
F2 by X4* X5 X6;

Then for Model 2 use:

F1 by X1* X2 X3;
F2 by X4* X5 X6;
F1 with F2@1;

I also tried the Model Test version as you suggested, but was unable to get it to work do to the wrong input. I consulted the manual, but cannot figure out how to do this.

Many thanks if you could confirm!
 Bengt O. Muthen posted on Wednesday, June 26, 2013 - 2:27 pm
Looks correct.

Model test would say:

0 = p1-1;

where p1 is the label for F1 WITH F2.
 Steve posted on Thursday, June 27, 2013 - 3:34 am
Dear Bengt,

Thanks so much for your help!
 Sindra Sharma-Khushal posted on Monday, January 27, 2014 - 7:04 am
I was reading up on parameter constraints in SEM and was unclear on why one would want to fix a parameter to 1 or 0 as follows:

y on x1 x2@1 x3
y on x1 x2@0 x3

Would you be able to point me to any relevant literature?

 Linda K. Muthen posted on Monday, January 27, 2014 - 11:48 am
The constraints in your model should be based on theory, your hypotheses, and your research questions. Usually, paths are left out of a model not fixed to a value other than zero.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message