Basic SEM model Constraints PreviousNext
Mplus Discussion > Structural Equation Modeling >
Message/Author
 Joseph Cote posted on Friday, June 08, 2012 - 6:11 pm
How can you constrain basic SEM parameters is MPlus? I am trying to constrain the variance of TD(31,31)> 0 (the estimated error variance is negative). But I can't find information about the notation used in MPLUS for various parameters. In EQS I would use the command /CON (E31,E31)>0; (for V31=*F1+E31;).

I assume the command would be something like the following with "TD31" replaced with the appropriate name for the parameter.
MODEL CONSTRAINT:
NEW(TD31);
TD31>0;

I tried
f11 by CInspir2* CInspir3 CInspir1 (ineq);
f11@1;
Model Constraint:
ineq<1;

This fixed the negative error variance problem, but caused all the loadings for f11 to be equal.

It would also be helpful to know how to extend this to other parameters (lambda, beta, psi, phi, etc).

I have read the Model Constraints section of the manual and search the discussion postings and web - sorry, I am still at a loss of how to do this. Thank you for your help.
 Bengt O. Muthen posted on Friday, June 08, 2012 - 8:32 pm
If you have say

f by y1-y3;
y1-y3 (resvar1-resvar3);

you can constrain these residual variances to be > 0 by:

Model Constraint:
resvar1>0;
resvar2>0;
resvar3>0;
 Joseph Cote posted on Wednesday, June 13, 2012 - 2:05 pm
Bengt,

Thank you for the help. Just for clarification, where can I read more about commands like y1-y3 (resvar1-resvar3) for SEM?
 Bengt O. Muthen posted on Wednesday, June 13, 2012 - 2:25 pm
See the Mplus V6 UG, pp. 615-617. See also UG ex 5.20.
 Aleksandra Luksyte posted on Monday, November 05, 2012 - 6:11 pm
Hello,
how can I constrain factor loadings and error variances to specific values? I tried this syntax, but it gives me error messages "A parameter label or the constant 0 must appear on the left-hand side of a MODEL CONSTRAINT statement.' Here is my code:
MODEL:
CREAT BY creat1-creat9;
INCIV BY inciv1-inciv7;
COMMUN BY commun1-commun5;
commun1-commun5 (resvar1- resvar5);
Model Constraint:
0.958 = commun1;
0.999 = commun2;
0.581 = commun3;
0.950 = commun4;
0.974 = commun5;
0.410 = resvar1;
0.325 = resvar2;
1.120 = resvar3;
0.297 = resvar4;
0.289 = resvar5;

Thank you for your help!
 Linda K. Muthen posted on Tuesday, November 06, 2012 - 5:53 am
You do not need to use MODEL CONSTRAINT to fix parameters to particular values. You can do this in the MODEL command, for example,

COMMUN BY commun1*@0.958 commun2@0.999
commun3@0.581 commun4@0.950 commun5@0.974;
commun@1;
 Aleksandra Luksyte posted on Tuesday, November 06, 2012 - 5:05 pm
Thank you, Linda, for your prompt reply! How can I constraint error variances? I tried this syntax and I get the error message that "Unknown variables: RESVAR1 in line: RESVAR1@0.410."
MODEL:
CREAT BY creat1-creat9;
INCIV BY inciv1-inciv7;
COMMUN BY commun1@0.958 commun2@0.999
commun3@0.581 commun4@0.950 commun5@0.974;
commun1-commun5 (resvar1-resvar5);
resvar1@0.410;
resvar2@0.325;
resvar3@1.120;
resvar4@0.297;
resvar5@0.289;
CREAT@1;
INCIV@1;
COMMUN@1;
 Linda K. Muthen posted on Tuesday, November 06, 2012 - 5:32 pm
You can't use variable names in MODEL CONSTRAINT and you can't use labels to refer to parameters in the MODEL command.

MODEL:
CREAT BY creat1-creat9;
INCIV BY inciv1-inciv7;
COMMUN BY commun1@0.958 commun2@0.999
commun3@0.581 commun4@0.950 commun5@0.974;
commun1-commun5;
commun1@0.410
etc.
 Aleksandra Luksyte posted on Tuesday, November 06, 2012 - 5:45 pm
Linda, it worked! Thank you so much for your prompt help!
 Frauke Günther posted on Friday, January 11, 2013 - 5:55 am
Dear Drs. Muthen,

I am trying to estimate an interaction/mediation effect using the model constraint option. Is it possible to constrain the regression coefficients obtained from the on statement? Trying the following, I get the fatal error THIS PARAMETER RESTRICTION MODEL IS NOT AVAILABLE. I would be very happy if you could have a look on my code and perhaps tell me where the error lies. Thank you very much in advance.

VARIABLE: NAMES ARE x1-x21;
USEVARIABLES ARE x1-x14 x19-x21;
CATEGORICAL ARE x1-x3;
MISSING =.;

CONSTRAINT ARE fto1 fto2;

DEFINE: ! Definition of dummy variables
x15_1=0;
IF (x15==2) THEN x15_1 = 1;
x15_2=0;
IF (x15==3) THEN x15_2 = 1;
STANDARDIZE x4-x14 x19-x21;

MODEL: ! Specification of the measurement model
F1 BY x1* x2@1 x3;
F2 BY x5-x10;
F3 BY x11* x12@1 x13 x14;
F4 BY x19-x21;

! Specification of the structural model
F4 on F1 (b1)
F2 (b2)
F3 (b3);

MODEL CONSTRAINT: NEW(int15*0 int15_1*1 int15_2*1);
b1 = int15 + int15_1*x15_1 + int15_2*x15_2;
 Linda K. Muthen posted on Friday, January 11, 2013 - 10:55 am
I think what you want is something like:

int | f1 XWITH f2;

f4 ON f1 f2 int;

I don't understand your specification in MODEL CONSTRAINT.
 Frauke Günther posted on Monday, January 14, 2013 - 3:48 am
Thank you very much for your answer. I tried that. Actually, I want to estimate an interaction between a categorical variable with three categories and a latent construct. Thus, I think I have to specify two interaction terms using dummy variables:
int_1 | F1 XWITH x_1; !x_1 representing x==2;
int_2 | F1 XWITH x_2; !x_2 representing x==3;
F4 on F1 F2 F3 x_1 x_2 int_1 int_2;
The output of this model (parameter specification) indicates that the observed variables x_1 and x_2 are treated as latent variables because both variables have corresponding entries in the beta matrix and for both dimensions in the lambda matrix. Is this correct or just a notational problem? Thank you again very much for your support.
 Linda K. Muthen posted on Monday, January 14, 2013 - 10:33 am
That the variables have entries in beta is not meaningful. It is an Mplus convention with no statistical ramifications.
 Frauke Günther posted on Monday, January 14, 2013 - 11:36 pm
Thank you very much for your support!
 J.D. Smith posted on Monday, March 04, 2013 - 9:34 am
I am trying to conduct a Wald test and I am interested in the significance of the change in R^2. I know you can specify a "new" parameter in the Model Constraint command and define it for comparison but I have been unable to find the correct syntax for the R^2 parameter? Any guidance would be appreciated.
Thank you!
 Linda K. Muthen posted on Monday, March 04, 2013 - 9:46 am
R-square is one minus the standardized residual variance.
 Peter Hilpert posted on Friday, October 11, 2013 - 1:19 am
Dear Drs. Muthen,
I have an APIM (dyadic data) with two indipendent variables and two mediators and I want to test, whether mediation differs between genders. I try to restrict the indirect effects to be equal, but I am not sure how to do this.

MODEL:
...

MODEL INDIRECT:

tmsm IND tconfm tanxim (p1);
tmsm IND tconff tanxim;
tmsm IND tconff tanxieF;
tmsm IND tconfm tanxieF;

tmsF IND tconff tanxieF (p2);
tmsF IND tconfm tanxieF;
tmsF IND tconfm tanxim;
tmsF IND tconff tanxim;


! Now, the indirect effect p1 should be set equal with p2, but I am not sure how to do this with the model contraint command.

MODEL CONSTRAINT:
NEW (p1 p2);
p1 = p2;

But if I let this model run, I get the following output:
THE DEGREES OF FREEDOM FOR THIS MODEL ARE NEGATIVE. THE MODEL IS NOT
IDENTIFIED. NO CHI-SQUARE TEST IS AVAILABLE. CHECK YOUR MODEL.

... and the degrees of freedom are -1 instead of 1. What would be the correct way to put the two indirect effects to be equal?

Thank you for your support
 Linda K. Muthen posted on Friday, October 11, 2013 - 10:34 am
You cannot use labels in MODEL INDIRECT. You would need to create the indirect effects in MODEL CONSTRAINT using labels from the MODEL command and test their equality in MODEL CONSTRAINT.
 Peter Hilpert posted on Wednesday, October 16, 2013 - 7:59 am
Dear Linda,

Thanks for your fast replay. I tried to do it but now I get another error message. In order to get the indirect effects, I made the following syntax:

MODEL:
...

MODEL INDIRECT:
...

MODEL CONSTRAINT:
NEW (p1 p2);
p1 = (tmsm ON tcomnm)*(tcomnm ON tanxim);
p2 = (tmsF ON tcomnf)*(tcomnf ON tanxieF);
p1=p2;

Even though I used the variables from the data set, I get the following error mesage:

*** ERROR
Unknown parameter label in MODEL CONSTRAINT: TMSM

Hmm, what should I change (it is the correct name of the dependent variable)?

Thanks and best regards
 Linda K. Muthen posted on Wednesday, October 16, 2013 - 12:55 pm
Please read MODEL CONSTRAINT in the user's guide. The ON option is not part of it and parameter labels not variable names are used in MODEL CONSTRAINT.
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: