David A. Kenny
May 15, 2011
APIM with Distinguishable Dyads Macro
This
moderation macro, called APIMDtext, was written by David A. Kenny, Department
of Psychology,
The
APIM is a model for dyadic data. It is
assumed that the data have a pairwise structure. The dataset needs to be in pairwise format.
To convert an individual file to a pairwise data click here. One variable has an effect on another and
that effect is the effect of one’s own score, the actor effect, and the effect
of one’s partner, the partner effect. It
is assumed that the dyad members are distinguishable, e.g., one member is the
husband and the other member is the wife.
Thank You!
I
thank my good friend Linda Acitelli for the sample data.
Download:
APIMDText.SPS (You need SPSS to open this and the next
3 files.)
Macro Output (You do not need SPSS to open this
file. But if you do not use “wordwrap” it will look ugly.)
To understand how
to run a macro return to the DataToText page.
The macro takes a few minutes to run and so be patient. Make sure to
backup the raw data file, as sometimes an error in the macro can alter the data
file.
PLEASE
READ THIS: Note that the
output (the text file you name) cannot be viewed in SPSS and is not written to
the SPSS output file. You need to view it in text reader (e.g.,
Notepad). When viewing the file, make sure to use “wordwrap” and Courier
or New Courier font.
The Macro Call
This is the
statement for the sample data:
APIMDText a = RSpouse/p = PSpouse /y =
RSatisfied /distvar=Rgender /dyadid = coupleid
xn = 'Other Positivity' yn = 'Satisfaction' clist=
yearsmarried.
The defaults are
as follows:
a = Actor
p = Partner
y = Outcome
distvar = DistVar
xn ='X'
yn ='Y'
alpha =.05
ofile ='APIMDtext.txt'
clist =
directory ='C:\'
That is, if you
just say “APIMDText.”, the program will assume that are variables in the SPSS
data file with variables named Actor, Partner, Outcome, and DistVar.
The data file
should be open; values should be given for both levels of the distinguishing
variable in the SPSS file.
APIMDtext was
written on SPSS 16 and 18 and there is no guarantee that it work on earlier or
later versions of SPSS. It appears that the three tables at the end of the file
are not correct if SPSS 15 or earlier is run.
The macro:
allows for only a single actor and partner
variable, distinguishing variable, and outcome,
presumes that effects are linear and not
non-linear (e.g., quadratic)
presumes that the outcome variable is
measured on an interval scale, and
uses listwise deletion.
Variables in the
macro:
a = name of the causal variable
for the person in the SPSS data set (do not use quotes for any of the SPSS
names)
p = name of the causal variable
for the partner in the SPSS data set
y = name of the moderating
variable in the SPSS data set
distvar
= name of the distinguishing variable; must be a dichotomy and each member must
have different scores; labels for the two categories should be provided
xn = name of the causal variable
in the text output (use quotes; spaces are allowed)
yn = name of the outcome
variable in the text output (use quotes; spaces are allowed)
(For the above two
variables, it is advised to use English names and not SPSS acronyms. Also
it is advised to capitalize the first letter of each word.)
alpha = significance level
(defaults to .05)
ofile = the name of the output
file (use quotes); this is where you go to find the text
clist = the SPSS names of the
covariates separated by spaces
directory = the name of the
directory where temporary files are written (use quotes); this must be a
directory you are allowed to write on; APIMDtext will leave some files on this
directory when it is done; I am working on finding a way to erase them.
It is safest to
give arguments for all macro variables. Note carefully what terms have
quotes and what do not and where the slashes are where they are not.
There is no
guarantee for accuracy. Examine not only DataToText output file, but also
the SPSS output file. The user needs to edit the APIMDtext output in research
reports. Please cite APIMDtext if you do use it. Please cite this ApimText webpage if you do use it. Moreover, you need
a footnote that says: “Some of the material here was produced by the SPSS macro
ApimDText (Kenny, 2011).”
If a non-English
version of SPSS is being used, APIMDtext changes the language to English.
It does not currently change the language back to the original language.
Warnings
APIMDtext
provides several possible warnings. The user needs to pay careful
attention to them.
1. With covariates, ApimDText can fail to remove
missing cases on the covariates. The
researcher should remove those cases before undertaking the analysis.
2. The outcome variable is a dichotomy and
logistic regression and not ordinary regression should be used.
3. The actor and partner variables are high
correlated and this colinearity compromises the analysis.
4. Because zero is not a possible value for the cause
variable, grand-mean centering that variable should be considered.
5. Because the causal variable is a dichotomy,
the product term and discrepancy score are perfectly correlated and only one of
the two should be reported.
Links
Macro Output
If Notepad is
used make sure you use the wordwrap option in formal. Also for the tables
to align use Courier font.
The output using
sample data:
WARNING: 1.
With covariates, ApimDText can fail to remove missing cases on the
covariates. The researcher should remove
those cases before undertaking the analysis.
Actor-Partner
Interdependence Model for Husband and Wife
The focus of this study is the
investigation of the effect of Other Positivity on Satisfaction and how that
effect differs for Husband and Wife.
Both the effect of own Other Positivity (actor) and the effect of
partner's Other Positivity (partner) on Husband's and Wife's Satisfaction are
studied. There are a total of 148 dyads
with no missing data, each with one Husband and one Wife. The total number of individuals is 296. The means and standard deviations for Husband
and Wife are presented in Table 1. There
is one covariate that is controlled in all analyses. The covariate explains a statistically
significant amount of variance of Satisfaction controlling for actor and
partner effects (.035 proportion of the total variance for the Husband and .011
proportion for the Wife), chi square test with 1 degree of freedom equal to
6.126 (p = .013).
RESULTS
Actor Effects
The actor effect for Husband is equal to
.374 and is statistically significant (p < .001), with a small effect size
(beta = .289), and the actor effect for Wife is equal to .523 and is
statistically significant (p < .001), with a medium effect size (beta =
.404). (See Table 2 for the actor effect
estimates.) The difference between these
two actor effects is not statistically
significant (p = .312).
Partner Effects
The partner effect from Wife to Husband
is equal to .372 and is statistically significant (p < .001), with a small
effect size (beta = .242). The partner effect from Husband to Wife is equal to
.261 and is statistically significant (p = .005), with a small effect size
(beta = .201). (See Table 2 for the
partner effect estimates.) The
difference between these two partner effects is
not statistically significant (p = .454).
Actor-Partner
Interactions
The actor-partner interaction for Husband
Satisfaction is equal to -.214 and is not statistically significant (p =
.322). The partner effect for persons
who are one standard deviation above the mean on Other Positivity is .261 and
for persons who are one standard deviation below the mean on Other Positivity
is .485. Additionally, the actor-partner
interaction Wife Satisfaction is equal to -.134 and is not statistically
significant (p = .523). The partner
effect for persons who are one standard deviation above the mean on Other
Positivity is .202 and for persons who are one standard deviation below the
mean on Other Positivity is .324. The
difference between the Husband and Wife interaction effects is not statistically significant (p = .711).
The effect of the absolute difference of
the two members on Other Positivity for Husband's Satisfaction is equal to
-.095 and is not statistically significant ((p = .491). Thus, if two members have the same score on
Other Positivity, their score on Husband's Satisfaction is .095 units higher
than it is for a dyad whose scores on Satisfaction differ by one unit. The effect of the absolute difference of the
two members on Other Positivity for Wife's Satisfaction is equal to -.073 and
is not statistically significant (p = .585).
Thus, if two members have the same score on Other Positivity, their
score on Wife's Satisfaction is .073 units higher than it is for a dyad whose
scores on Satisfaction differ by one unit.
The difference between these two discrepancy effects is not statistically significant (p = .876).
Effect of the
Distinguishing Variable
The predicted score on Satisfaction for
those who score zero on Other Positivity is 3.608 for Husband and 3.583 for
Wife and that difference is not statistically significant (p = .620), with a
less than small effect size (d = .043).
Relation of Actor
and Partner Effects
An analysis was made of the relative size
of actor and partner effects. For
Husband, there is evidence for "couple model" (Kenny & Cook,
1999) in that the actor and partner effects are not statistically significantly
different. It may make sense to sum or
average the two Other Positivity scores for Husband. For Wife, there is evidence for "couple
model" (Kenny & Cook, 1999) in that the actor and partner effects are
not statistically significantly different. It may make sense to sum or average
the two Other Positivity scores for Wife. not statistically significantly
different. It may make sense to sum or
average the two Other Positivity scores.
Error Variances
and Correlation
The correlation between Husband errors
with Wife errors is equal to .444. Thus,
the two members of the dyad are similar to one another. The error variance for Husband is equal to
.346 and for Wife is .323. The R squared
(Kenny, Kashy, & Cook, 2006), controlling for the covariate, for the
Husband is equal to .190 and for the Wife is equal to .212.
Test of
Distinguishability
The test of distinguishability yields a
chi square test with four degrees of freedom that equals 1.561 with a p value
of .816. Because the test of distinguishability is not statistically significant,
we conclude that members are statistically indistinguishable. The test of the
effect of the distinguishing variable is not statistically significant (p =
.620). The test of the interaction of the distinguishing variable with the
actor effect is not statistically significant (p = .312), and the test
interaction of the distinguishing variable with the partner effect is not
statistically significant (p = .454).
Finally, the test that error variances are different is not
statistically significant (p = .632).
Treating Dyad
Members as Indistinguishable
In the analyses that follow, we ignore
differences between Husband and Wife.
The overall actor effect is equal to .441 and is statistically
significant (p < .001), with a medium effect size (beta = .340). The overall partner effect is equal to .313
and is statistically significant (p < .001), with a small effect size (beta
= .242). The intraclass correlation
treating dyad members as indistinguishable is equal to .448 and the R squared
is equal to .323. Treating the dyad
members as indistinguishable, there is evidence for "couple model"
(Kenny & Cook, 1999) in that the actor and partner effects are
The actor-partner interaction is equal to
-.181 and is not statistically significant ((p = .322). The partner effect for persons who are one
standard deviation above the mean on Other Positivity is .224 and for persons
who are one standard deviation below the mean on Other Positivity is .404. Alternatively, the effect of the absolute
difference of the two members on Other Positivity is equal to -.073 and is not
statistically significant (p = .527).
Thus, if two members have the same score on Other Positivity, their
score on Satisfaction is .073 units higher than it is for a dyad whose scores
on Satisfaction differ by one unit.
Treating dyad members as indistinguishable, there is not evidence of an
actor-partner interaction.
Table 1: Descriptive
Statistics
Variable Mean Standard Deviation
---------------------------------------------------------
Other Positivity
Husband -.018 .523
Wife .018 .474
Satisfaction
Husband 3.608 .656
Wife 3.588 .638
Table 2: Effect Estimates
Effect Coefficient p value
Beta
----------------------------------------------------------------
Actor
(Husband) .374 <.001 .289
Actor (Wife) .523 <.001 .404
Partner (Wife to
Husband) .372 <.001 .242
Partner (Husband
to Wife) .261 .005 .201
Figure 1
APIM Diagram
.374*
Husband _________________________> Husband
Other Positivity Satisfaction
/\ \
/\ /\
/ \ / \
( \ / \
( \ / \
( \ / E1
( \ / )
.055*
[ X ] .149*
( / \
)
( .372* /
\ .261* E2
( / \ /
( / \ /
\ / \ /
\/ / \/ \/
Wife .523* Wife
Other Positivity _________________________> Satisfaction
* p < .05
References
Kenny, D. A., & Cook, W.
(1999). Partner effects in relationship
research: Conceptual issues, analytic
difficulties, and illustrations. Personal Relationships, 6, 433-448.
Kenny, D. A., Kashy, D. A., & Cook,
W. (2006). Dyadic data analysis.