Syntax for mutual influence APIM model? PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Joseph Trombello posted on Thursday, December 19, 2013 - 8:44 am
Hello.

I've looked through the User's Manual and this website but seem to be struggling on the appropriate syntax for the following model.

I want to test partner effects (i.e., husbands' predictor 1 and predictor 2 scores on wives' outcome variable) and vice-versa. However, I will also need a mutual influence model, as I am interested in the effects between husbands' and wives' outcome scores. I ran a version of this (incorrectly) in multilevel modeling using HLM, and the link between husbands' and wives' outcome really seems to be the key significant variable.

Could anyone point perhaps to an example that would enable me to include both the partner effects for two predictors and the mutual influence between husbands' and wives' Y's?

Thank you.
 Bengt O. Muthen posted on Thursday, December 19, 2013 - 1:32 pm
Perhaps you find what you are interested in here:

James L. Peugh, David DiLillo & Jillian Panuzio (2013) Analyzing Mixed-Dyadic Data Using Structural Equation Models. Structural Equation Modeling. Pages: 314-337 DOI: 10.1080/10705511.2013.769395
 Joseph Trombello posted on Friday, December 27, 2013 - 2:42 pm
As a follow-up, I think I have my syntax mostly down, but I continue to get an error message that "horisk cannot be on the left-hand side of a BY command". Do you have any thoughts on how I may successfully run a partner effects and mutual influence model simultaneously?

My predictors are husband family-of-origin and wife family-of-origin distress alongside husband and wife depression history, to predict partner's scores on the risk variable as an outcome. However, I am also interested in whether one's own risk predicts risk in a partner (i.e., the relationship between husbands' and wives' risk scores ... or the mutual influence part).

TITLE: basic test

DATA: FILE = C:\Users\joetrombello\desktop\brief file for dom.sav;

VARIABLE: NAMES = cID hfoi wfoi horisk worisk hdep wdep;

ANALYSIS: TYPE = GENERAL;

MODEL: horisk ON wfoi wdep;
worisk ON hfoi hdep;
horisk BY worisk;

OUTPUT: SAMPSTAT STANDARDIZED STDYX

*** ERROR in MODEL command
horisk cannot be on the left-hand side of a BY statement.
 Bengt O. Muthen posted on Friday, December 27, 2013 - 4:12 pm
You have "horisk" as an observed variable in the NAMES list and then you are trying to define it as a latent variable using BY.
 Joseph Trombello posted on Saturday, December 28, 2013 - 12:50 pm
So I will need an ON or WITH instead?
 Linda K. Muthen posted on Saturday, December 28, 2013 - 1:39 pm
You cannot use the name of an observed variable on the left-hand side of a BY statement. A BY statement defines a factor. The name on the left-hand side of the BY statement should be the name of the factor defined by the BY statement. You should use ON for regression or WITH for covariance.
 Joseph Trombello posted on Tuesday, December 31, 2013 - 9:24 am
Is there a way to attach an output file on here? I think I finally have all the syntax down correctly for a mutual influence and partner effects model, but my estimates and standard errors for the wives' portions seem wildly off.
 Linda K. Muthen posted on Tuesday, December 31, 2013 - 9:26 am
Please send the output and your license number to support@statmodel.com.
 J.D. Haltigan posted on Sunday, December 18, 2016 - 7:52 pm
Hello:

Instead of the WIDE SEM-based approach to dyadic analyses outlined by Peugh, I am conducting a dyadic APIM analyses in the MLM setup. Looking to predict Y at T2....k from actor (autogressive) and partner (cross-influence) at time k-1.

Because I have the person-period-pairwise data set up (LONG), I am struggling with how to create the relevant time variables even using dummy codes for infant and parent (the individuals) because the two data vectors for actor and partner are stacked variables (thus, yield the same overall information). Is there an example of the APIM model within the MLM framework anyone could point me to?
 Bengt O. Muthen posted on Tuesday, December 20, 2016 - 2:01 pm
I am not familar with these various formats - you may want to ask on SEMNET. Not sure if our longtowide and widetolong reformatting options are helpful.
 Sarah Arpin posted on Tuesday, February 21, 2017 - 1:40 pm
Hello,

I am trying to test a mutual influence model for indistinguishable dyads, with indirect effects included (variation of APIMeM). I am having a difficult time finding syntax for this type of model. Do you have resources you would suggest, or suggested syntax?

Thank you!
 Bengt O. Muthen posted on Tuesday, February 21, 2017 - 1:57 pm
Try SEMNET. If you get a good answer using Mplus, please report here on it.
 J.D. Haltigan posted on Tuesday, February 21, 2017 - 2:37 pm
You may also want to check Cross-Validated where I posted on a variant of what you are asking in re: APIM and Mplus syntax. It may be helpful.
 Sarah Arpin posted on Wednesday, February 22, 2017 - 12:08 pm
Thank you! I will take a look at these other resources and definitely post an answer if I find one.
 Sarah Arpin posted on Thursday, August 31, 2017 - 3:01 pm
Hello,

I am trying to run an APIMeM model for indistinguishable dyads. I need to control for a third variable (C). Is the following syntax correct? That is, am I correctly specifying a model which tests for indirect effects of X on Y via M, for actors and partners, controlling for C for each dyad member? I expect the partner effects for path a to be zero, as I have specified in the syntax below.

TITLE: APIMeM indistinguishable members DATA: FILE is DataComplSelVar.csv;
VARIABLE: NAMES ARE X1 M1 Y1 X2 M2 Y2 C1 C2;
USEVAR = X1 M1 Y1 X2 M2 Y2 C1 C2;
analysis: estimator = ml;
bootstrap = 5000;
model:
M2 on X2 C2 (aa);
M2 on X1@0(ap);
M1 on X2@0 (ap);
M1 on X1 C1 (aa);
Y2 on M2 (ba);
Y2 on M1 (bp);
Y2 on X2 C2 (ca);
Y2 on X1 C1 (cp);
Y1 on M2 (bp);
Y1 on M1 (ba);
Y1 on X2 (cp);
Y1 on X1 (ca);
Y1 with Y2;
X2 with X1;
M2 with M1;
Model indirect:
Y2 ind X2;
Y2 ind X1;
Y1 ind X2;
Y1 ind X1;
output: stand; res; cinterval(bcbootstrap);

Thank you!
 Sarah Arpin posted on Thursday, August 31, 2017 - 3:54 pm
I posted the message above, and found a slight error in the syntax I pasted. Please reference this syntax instead when answering my question - my apologies!

TITLE: APIMeM indistinguishable members DATA: FILE is DataComplSelVar.csv;
VARIABLE: NAMES ARE X1 M1 Y1 X2 M2 Y2 C1 C2;
USEVAR = X1 M1 Y1 X2 M2 Y2 C1 C2;
analysis: estimator = ml;
bootstrap = 5000;
model:
M2 on X2 C2 (aa);
M2 on X1@0(ap);
M1 on X2@0 (ap);
M1 on X1 C1 (aa);
Y2 on M2 (ba);
Y2 on M1 (bp);
Y2 on X2 C2 (ca);
Y2 on X1 (cp);
Y1 on M2 (bp);
Y1 on M1 (ba);
Y1 on X2 (cp);
Y1 on X1 C1 (ca);
Y1 with Y2;
X2 with X1;
M2 with M1;
Model indirect:
Y2 ind X2;
Y2 ind X1;
Y1 ind X2;
Y1 ind X1;
output: stand; res; cinterval(bcbootstrap);
 Bengt O. Muthen posted on Thursday, August 31, 2017 - 4:56 pm
This looks reasonable.

Except, have only one parameter on each line with a label. And don't use WITH among the x's or c's - they are regular covariates.
 Sarah Arpin posted on Friday, September 01, 2017 - 8:36 am
Thank you for your fast response. When you say "have only one parameter on each line with a label", are you referring to the following (I've asterisked lines of the syntax that I edited based on your feedback):

TITLE: APIMeM indistinguishable members DATA: FILE is DataComplSelVar.csv;
VARIABLE: NAMES ARE X1 M1 Y1 X2 M2 Y2 C1 C2;
USEVAR = X1 M1 Y1 X2 M2 Y2 C1 C2;
analysis: estimator = ml;
bootstrap = 5000;
model:
M2 on X2 (aa);****Person 2 IV on Person 2 Mediator
M2 on C2 (aa);****covariate
M2 on X1@0(ap);
M1 on X2@0 (ap);
M1 on X1 (aa);**** Person 1 IV on Person 1 Mediator
M1 on C1 (aa);****covariate
Y2 on M2 (ba);
Y2 on M1 (bp);
Y2 on X2 (ca);**** Person 2 IV on Person 2 Y
Y2 on C2 (ca);****covariate
Y2 on X1 (cp);
Y1 on M2 (bp);
Y1 on M1 (ba);
Y1 on X2 (cp);
Y1 on X1(ca); **** Person 1 IV on Person 1 Y
Y1 on C1(ca); **** covariate
Y1 with Y2;
X2 with X1;
M2 with M1;
Model indirect:
Y2 ind X2;
Y2 ind X1;
Y1 ind X2;
Y1 ind X1;
output: stand; res; cinterval(bcbootstrap);


Thank you!
 Bengt O. Muthen posted on Friday, September 01, 2017 - 1:03 pm
Right.

But you can write this

M2 on X2 (aa);
M2 on C2 (aa);

more efficiently as (note: no semi colon at the end of the first line):

M2 on X2 (aa)
C2 (aa);
 Sarah Arpin posted on Friday, September 01, 2017 - 1:19 pm
This is so helpful. Thank you!
 Brian Feinstein posted on Thursday, September 21, 2017 - 12:05 pm
I noticed that Sarah's syntax didn't include the correlation between the covariate (C) and the predictor (X). Is that not necessary to account for the covariate?
 Bengt O. Muthen posted on Thursday, September 21, 2017 - 3:55 pm
Variables that appear only on the right-hand-side of ON are considered "X variables" and are allowed to correlate but their correlation is not part of the model (just like in regular regression). So this includes X2 and C2 of the example.
 Brian Feinstein posted on Friday, September 22, 2017 - 7:39 am
My mistake. Thanks for clarifying!
 Sarah Arpin posted on Thursday, October 26, 2017 - 6:49 pm
Hello,

I am having an issue running the syntax you suggested for including a control variable in an APIMeM model (indistinguishable dyads) - for context, see the discussion from September 1st, 2017.

Specifically, you suggested that I could write the following:

M2 on X2;
M2 on C2;

more efficiently as (note: no semi colon at the end of the first line):

M2 on X2
C2;

(C2 is my control variable).

However, I get very different results when I run the model each way. When I run the model the first way (separate lines, two semicolons), I get the following output:

M ON
X -0.860 0.352 -2.445

C2 ON
X 0.405 0.149 2.722

Running the abbreviated version (with no semicolon) you suggest on separate lines outputs the following:

M ON
X -0.480 0.176 -2.727
C2 0.043 0.037 -1.176


Which is correct? Shouldn't they output the same results?

Thank you!
 Bengt O. Muthen posted on Friday, October 27, 2017 - 4:45 pm
They should give the same result. Send your 2 outputs to Support along with your license number.
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: