Sem with within-subject variable PreviousNext
Mplus Discussion > Structural Equation Modeling >
 Karen Chan posted on Sunday, September 26, 2010 - 8:17 pm
hi all,

i'm wondering if i could study the relationship between some variables with sem. Here are the variables:

Independent variable - X1 (categorical, 2 levels, experimentally manipulated, within-subject), X2 (categorical, between-subject, moderator variable), X3/Y1 (continuous, within-subject, also a dependent variable)

Dependent variable - Y1/X3 (continuous, within-subject, also an independent variable), Y2 (continuous, within-subject)

The paths that i want to include are the following:

X2 has a moderating effect on X1->Y1

How can I do that using Mplus and how might the input file look like? I'm using the .dat file.
 Linda K. Muthen posted on Monday, September 27, 2010 - 10:22 am
WITHIN = x1 x3 y1 y3;

s | y1 ON x1;
y2 ON x3;
s ON x2;
 Amy Walzer posted on Saturday, February 22, 2014 - 8:42 pm
Hello all,

I am having some difficulty determining the syntax for the model I need to test. I believe it is a moderated mediation. Here are my variables:

- Gender - IV, Experimentally manipulated, categorical (2-levels), between subjects
- Comp - Mediator between Gender and Comp, continuous
- Goal Diff - DV, continuous
- Sexism - Moderator of Comp on Gender, continuous, between subjects
- Goal Type - Moderator of Goal Diff on Comp, experimentally manipulated, categorical (2 levels; learning goal vs. performance goal), within subjects

I want to know:

- Does Comp mediate the relationship between Gender and Goal Diff?
- Does Sexism moderate the relationship between Gender and Comp?
- Does Goal Type (within-subjects) moderate the relationship between Comp and Goal Diff?

What would the input look like for this model?

Given that Goal Type is a within-subjects variable, do I need to have two lines of data per participant, one for each Goal Type (learning goal and performance goal)? What analysis type would this be?

I know this is a lot to ask so any help people could provide would be greatly appreciated!

Warm regards,

 Linda K. Muthen posted on Sunday, February 23, 2014 - 12:19 pm
Example 3.18 is moderated mediation. See if that helps you.
 Amy Walzer posted on Saturday, April 19, 2014 - 11:20 am

Looking at the example was very helpful to me. Thank you!

I am still having difficulty figuring out how to deal with my within subjects manipulated variable (X2). I want to see if it moderates the relationship between a latent continuous variable (X1) and an observed dependent variable (Y).

Specifically, I assume I need two lines of data per participant (one for each level of X1). Is this correct? Also, what might this input look like?

Thank you for your help,

 Linda K. Muthen posted on Monday, April 21, 2014 - 10:01 am
You can create an interaction between a latent variable and an observed variable using the XWITH option.
 Amy Walzer posted on Tuesday, May 06, 2014 - 4:59 pm
I have figured that part out but I am now wondering if my data is set up correctly. I have a within subjects variable that was experimentally manipulated (2 levels). Does this mean I need two lines of data per person?
 Bengt O. Muthen posted on Tuesday, May 06, 2014 - 6:44 pm
No. Your X2 variable has 2 values. Some subjects (lines in your data) have one of the 2 levels some have the other.
 Amy Walzer posted on Tuesday, May 06, 2014 - 7:38 pm
So I may have been a little unclear in my previous post.

I am interested in whether X1 (a continuous, latent variable) is related to X2/Y1 (a within-subjects, 2-level, manipulated variable, also a dependent variable). I also want to know if X2 moderates the relationship between X1 and Y1.

Given that all of my participants completed the measures for both levels of the X2/Y1. I'm not sure I understand how I would not need two lines of data per person.

I really appreciate all of your help with this!
 Linda K. Muthen posted on Wednesday, May 07, 2014 - 7:33 am
It sounds like you would need one column for each condition. If each person completed each condition, I think they would have a value for each condition and therefore each condition would represent a variable.
 Amy Walzer posted on Wednesday, May 07, 2014 - 8:03 pm
That makes sense but with the within-subjects variable represented in two columns I'm not sure how I would test the within-subjects variable (X2/Y1) as a moderator between X1 (continuous, latent) and Y1. Can you provide any insight on this?
 Linda K. Muthen posted on Thursday, May 08, 2014 - 6:57 am
See Example 3.18. This shows moderated mediation.
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