library(dplyr)
library(dyadr)
library(nlme)
kashy <- read.csv("kashy.csv")
X and Y are measured at multiple times. The big advantage of this design over traditional APIM is that actor and partner effects become random variables.
As an example, we run an APIM with Conflict as the X variable and Satisfaction as the Y variable. For each dyad, we have potentially 14 replications.
As was done for growth curve models, we need to create new variables. I will do so in clumsier way, but the way I have done so in the past.
kashy <- kashy %>%
mutate(Actor_M = man*AconflictC,
Actor_W = woman*AconflictC,
Partner_M = man*PconflictC,
Partner_W = woman*PconflictC,
obsid = Day+14*(DYADID-1))
ctrl <- lmeControl(msMaxIter=10000,MaxIter=10000,msMaxEval=10000,
returnObject=TRUE,niterEM=10000,nlmStepMax=1000)
apimot <- lme(ASATISF ~ man + woman + Actor_M + Actor_W
+ Partner_M + Partner_W - 1,
data = kashy,
random = ~ man + woman
+ Actor_M + Actor_W + Partner_M + Partner_W -1 |DYADID,
correlation = corCompSymm(form = ~1|DYADID/obsid),
weights = varIdent(form = ~1|GENDER),control=ctrl,
na.action = na.omit)
smallsummary(apimot)
## Random effects:
## Formula: ~man + woman + Actor_M + Actor_W + Partner_M + Partner_W - 1 | DYADID
## Structure: General positive-definite, Log-Cholesky parametrization
## StdDev Corr
## man 0.65278194 man woman Actr_M Actr_W Prtn_M
## woman 0.49750818 0.792
## Actor_M 0.15064922 0.404 0.229
## Actor_W 0.15907621 0.264 0.482 0.131
## Partner_M 0.13787629 -0.009 0.074 -0.101 0.416
## Partner_W 0.09493208 0.475 0.424 0.615 0.461 -0.052
## Residual 0.50108605
##
## Value Std.Error DF t-value p-value
## man 6.2642 0.0663 2725 94.4535 0e+00
## woman 6.4078 0.0517 2725 124.0363 0e+00
## Actor_M -0.1493 0.0220 2725 -6.7978 0e+00
## Actor_W -0.1935 0.0219 2725 -8.8434 0e+00
## Partner_M -0.0676 0.0199 2725 -3.3970 7e-04
## Partner_W -0.0596 0.0181 2725 -3.2897 1e-03
## 2.5% 97.5%
## man 6.1341 6.3942
## woman 6.3065 6.5091
## Actor_M -0.1923 -0.1062
## Actor_W -0.2364 -0.1506
## Partner_M -0.1067 -0.0286
## Partner_W -0.0951 -0.0241
lincomb(apimot,1,2)
## [1] -0.1436161889 0.0435332589 0.0009703017
lincomb(apimot,1,2,"A")
## [1] 6.33598863 0.05531557 0.00000000
lincomb(apimot,3,4)
## [1] 0.04427283 0.03115302 0.15527579
lincomb(apimot,3,4,"A")
## [1] -0.17139057 0.01542262 0.00000000
lincomb(apimot,5,6)
## [1] -0.00802928 0.02843128 0.77762911
lincomb(apimot,5,6,"A")
## [1] -6.361940e-02 1.265925e-02 5.020553e-07
lincomb(apimot,3,5)
## [1] -0.08162012 0.03357106 0.01504623
lincomb(apimot,4,6)
## [1] -1.339222e-01 2.955563e-02 5.865205e-06
The intercepts differ by gender, something we have seen before.
However, the actor and partner effects do not different differ by gender.
The actor effects for both men and women are larger in absolute value (in this case more negative) than the partner effects.
More detailed explanation of results are given for the person-centered analysis.
We subtract means and add them as a dyad-level predictor.
kashy <- kashy %>%
mutate(Actor_Mpc = man*AconflictCC,
Actor_Wpc = woman*AconflictCC,
Partner_Mpc = man*PconflictCC,
Partner_Wpc = woman*PconflictCC,
M_MeanA = man*AconflictC_mean,
W_MeanA = woman*AconflictC_mean,
M_MeanP = man*PconflictC_mean,
W_MeanP = woman*PconflictC_mean)
apimotpc <- lme(ASATISF ~ man + woman
+ Actor_Mpc + Actor_Wpc + Partner_Mpc + Partner_Wpc
+ M_MeanA + W_MeanA + M_MeanP + W_MeanP + - 1,
data = kashy,
random = ~ man + woman +
Actor_Mpc + Actor_Wpc + Partner_Mpc + Partner_Wpc -1
|DYADID,
correlation = corCompSymm(form = ~1|DYADID/obsid),
weights = varIdent(form = ~1|GENDER),control=ctrl,
na.action = na.omit)
smallsummary(apimotpc)
## Random effects:
## Formula: ~man + woman + Actor_Mpc + Actor_Wpc + Partner_Mpc + Partner_Wpc - 1 | DYADID
## Structure: General positive-definite, Log-Cholesky parametrization
## StdDev Corr
## man 0.62731952 man woman Actr_M Actr_W Prtn_M
## woman 0.50898373 0.762
## Actor_Mpc 0.15298218 0.396 0.190
## Actor_Wpc 0.15425974 0.255 0.459 0.125
## Partner_Mpc 0.13639373 -0.016 0.059 -0.097 0.410
## Partner_Wpc 0.08777219 0.430 0.346 0.650 0.468 -0.059
## Residual 0.50077206
##
## Value Std.Error DF t-value p-value
## man 6.2524 0.0641 2721 97.5469 0.0000
## woman 6.3896 0.0528 2721 120.9754 0.0000
## Actor_Mpc -0.1489 0.0221 2721 -6.7308 0.0000
## Actor_Wpc -0.1940 0.0216 2721 -8.9895 0.0000
## Partner_Mpc -0.0626 0.0199 2721 -3.1388 0.0017
## Partner_Wpc -0.0591 0.0180 2721 -3.2886 0.0010
## M_MeanA -0.3305 0.1018 2721 -3.2468 0.0012
## W_MeanA -0.2310 0.0816 2721 -2.8317 0.0047
## M_MeanP -0.2313 0.0998 2721 -2.3182 0.0205
## W_MeanP -0.2215 0.0829 2721 -2.6731 0.0076
## 2.5% 97.5%
## man 6.1267 6.3780
## woman 6.2860 6.4932
## Actor_Mpc -0.1923 -0.1056
## Actor_Wpc -0.2363 -0.1517
## Partner_Mpc -0.1016 -0.0235
## Partner_Wpc -0.0944 -0.0239
## M_MeanA -0.5302 -0.1309
## W_MeanA -0.3910 -0.0710
## M_MeanP -0.4270 -0.0357
## W_MeanP -0.3840 -0.0590
lincomb(apimotpc,1,2)
## [1] -0.137235442 0.043959945 0.001797311
lincomb(apimotpc,1,2,"A")
## [1] 6.32097090 0.05445965 0.00000000
lincomb(apimotpc,3,4)
## [1] 0.04507702 0.03107899 0.14694649
lincomb(apimotpc,3,4,"A")
## [1] -0.17148679 0.01537215 0.00000000
lincomb(apimotpc,5,6)
## [1] -0.003448439 0.028326308 0.903105081
lincomb(apimotpc,5,6,"A")
## [1] -6.083439e-02 1.263142e-02 1.463795e-06
lincomb(apimotpc,3,5)
## [1] -0.08638967 0.03373273 0.01043699
lincomb(apimotpc,4,6)
## [1] -1.349151e-01 2.955741e-02 5.006606e-06
lincomb(apimotpc,3,7)
## [1] 0.18159300 0.10250660 0.07647345
lincomb(apimotpc,4,8)
## [1] 0.03698928 0.08263015 0.65440679
lincomb(apimotpc,5,9)
## [1] 0.16875658 0.10165589 0.09689901
lincomb(apimotpc,6,10)
## [1] 0.16242129 0.08374125 0.05243301
lincomb(apimotpc,7,9)
## [1] -0.09922609 0.16453795 0.54646947
lincomb(apimotpc,8,10)
## [1] -0.009483118 0.134337969 0.943722882
There is pleasantly enough little change that occurs due to person centering. Such a result suggest the the within and between person effects of Conflict on Satisfaction are fairly similar.
All effects are negative, but actor effects are larger than partner effects. One could test if coefficients are different, but we have not done this. So if your are curious make such tests. There do not appear to be gender differences in these effects.
It is interesting to note that random effect standard deviations for the partner effect are larger than their fixed effects. That means that a decent percentage of people have positive partner effects. Does it make sense to believe that one is more satisfied in the relationship on a given day, if one’s partner is feeling a lot of conflict on that day?
As before, the intercepts differ by gender, the actor and partner effects do not different differ by gender, and the actor effects for both men and women are larger in absolute value (in this case more negative) than the partner effects.
Despite the differences, the mean effect are not statistically larger than the within-person effects, which is consistent with the similarity in the two sets of analyses.
The means show a clear couple-level model, whereas the within-person effects do not. Not clear what if anything this means, but it may be interesting.