David A. Kenny

June 29, 2014

 

APIM with Distinguishable Dyads Macro

 

This moderation macro, called APIMDtext, was written by David A. Kenny, Department of Psychology, University of Connecticut .  This is Version 1, completed on May 25, 2010 and revised on May 15, 2011 and May 22, 2012 and again on January 18, 2013.  This marco may well contain errors and will certainly be revised, and so it is advisable to return for updates. A correction was made on June 29, 2014. This macro has been replaced by shiny app that can be accessed at APIM_MM and an extensive description is available on here.

 

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 can be either the effect from one’s own score, the actor effect, or the effect from 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. I also than Jessica Fales who previously pointed out an error to me.

 

Download:

APIMDText.SPS (You need SPSS to open this and the next 3 files.)

Sample Data File (Best to give plural labels to the two levels of the distinguishing variable, e.g., "Husbands" and "Wives".)

Macro Call

SPSS Output

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

     directory='c:\' xn =  'Other Positivity' yn = 'Satisfaction' clist= yearsmar.

 

The defaults are as follows:

a = Actor

p = Partner

y = Outcome

distvar = DistVar

directory ='C:\'

xn ='X'

yn ='Y'

alpha =.05

ofile ='APIMDtext.txt'

clist =

 

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

   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.

   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

 

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). Any material in your paper that is verbatin must be enclosed in quotes.”

 

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

 

DataToText Page

 

Frequently Asked Questions

 

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:

 

WARNINGS: 1. With covariates, ApimDText can fail to remove missing cases on the covariates. The researcher should remove those cases before undertaking the analysis. 2. Because zero is not a possible value for Other Positivity, grand-mean centering that variable should be considered.

Actor-Partner Interdependence Model for Wives and Husbands.

The focus of this study is the investigation of the effect of Other Positivity on Satisfaction and how that effect differs for Wives and Husbands. Both the effect of own Other Positivity (actor) and the effect of partner's Other Positivity (partner) on Satisfaction for Wives and Husbands are studied. There are a total of 148 dyads with no missing data. The total number of individuals is 296. The means and standard deviations for Wives and Husbands 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 (.006 proportion of the total variance for the Wives and .016 proportion for the Husbands), chi square test with 1 degree of freedom equal to 9.849 (p = .002).

RESULTS

Actor Effects

The actor effect for Wives is equal to .384 and is statistically significant (p < .001), with a medium effect size (beta = .386), and the actor effect for Husbands is equal to .442 and is statistically significant (p < .001), with a medium effect size (beta = .443). (See Table 2 for the actor effect estimates.) The difference between these two actor effects is not statistically significant (p = .584).

Partner Effects

The partner effect from Husbands to Wives is equal to .339 and is statistically significant (p < .001), with a small effect size (beta = .323). The partner effect from Wives to Husbands is equal to .268 and is statistically significant (p < .001), with a small effect size (beta = .269). (See Table 2 for the partner effect estimates.) The difference between these two partner effects is not statistically significant (p = .508).

Actor-Partner Interactions

The effect of the product of actor and partner variables on Satisfaction for Wives is equal to -.150 and is not statistically significant (p = .367). The partner effect for persons who are one standard deviation above the mean on Other Positivity is .258 and for persons who are one standard deviation below the mean on Other Positivity is .414. Additionally, the effect of the product of actor and partner variables on Satisfaction for Husbands is equal to -.356 and is statistically significant (p = .010). The partner effect for persons who are one standard deviation above the mean on Other Positivity is .101 and for persons who are one standard deviation below the mean on Other Positivity is .438. The difference between the interaction effects for Wives and Husbands is not statistically significant (p = .179).

The effect of the absolute difference of the two members' scores for the variable Other Positivity on Satisfaction of Wives is equal to -.040 and is not statistically significant (p = .711). Thus, if two members have the same score on Other Positivity, the score on Satisfaction for Wives is .040 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' scores for the variable Other Positivity on Satisfaction of Husbands is equal to .022 and is not statistically significant (p = .802). Thus, if two members have the same score on Other Positivity, their score on Satisfaction for Husbands is .022 units lower 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 = .540).

Effect of the Distinguishing Variable

The predicted score on Satisfaction for those who score zero on Other Positivity is .510 and .590 for Husbands, and that difference is not statistically significant (p = .840), with a small effect size (d = -.190).

Relation of Actor and Partner Effects: Testing for Patterns

An analysis was made of the relative size of actor and partner effects to determine if there were any patterns in the effects. For Wives, 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 Wives. For Husbands, 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 Husbands.

Error Variances and Correlations

The correlation between Wives errors with Husbands errors is equal to .470. Thus, the two members of the dyad are similar to one another. The error variance for Wives is equal to .206 and for Husbands is .141. The R squared (Kenny, Kashy, & Cook, 2006), controlling for the covariate, for the Wives is equal to .269 and for the Husbands is equal to .343. Finally, the correlation between Other Positivity for Wives and Husbands is equal to .224.

Test of Distinguishability

The test of distinguishability yields a chi square test with four degrees of freedom that equals 7.786 (p = .100). 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 = .840). The test of the interaction of the distinguishing variable with the actor effect is not statistically significant (p = .584), and the test interaction of the distinguishing variable with the partner effect is not statistically significant (p = .508). Finally, the test that error variances are different is statistically significant (p = .009).

Treating Dyad Members as Indistinguishable

In the analyses that follow, we ignore differences between Wives and Husbands. The overall actor effect is equal to .411 and is statistically significant (p < .001), with a medium effect size (beta = .413). The overall partner effect is equal to .299 and is statistically significant (p < .001), with a small effect size (beta = .300). The intraclass correlation treating dyad members as indistinguishable is equal to .465 and the R squared is equal to .141. Treating the dyad members as indistinguishable, 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. The actor-partner interaction is equal to -.256 and is not statistically significant (p = .052). The partner effect for persons who are one standard deviation above the mean on Other Positivity is .172 and for persons who are one standard deviation below the mean on Other Positivity is .427. Alternatively, the effect of the absolute difference of the two members on Other Positivity is equal to -.003 and is not statistically significant (p = .975). Thus, if two members have the same score on Other Positivity, their score on Satisfaction is .003 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.

(Tables, figure, and references not included here.)

 

Return to the Top of the Page

 

Return to the DataToText Page