Overview

The one-with-many (OWM) model (Kenny & Winquist, 2001; Kenny, Kashy, & Cook, 2006, Chapter 10) is a dyadic analytic technique that exists in the middle ground between the standard (APIM-type; QuantDev APIM Tutorial) dyadic model and the social relations (round robin-type) model, as can be seen in the figure below.

The OWM model was specifically constructed for and is used to examine features of multiple dyadic relationships a set of focal persons (e.g., therapists, physicians) has with others (e.g., multiple clients, patients). While this model was originally designed for and applied to cross-sectional data, the model can be extended to accommodate and may be particularly useful for the analysis of intensive repeated measures data now being obtained through experience sampling and social media. A more in-depth description and illustration of this model can be found in Brinberg, Ram, Conroy, Pincus, and Gerstorf (under review).

In this tutorial, we will walk through two- and three-level OWM models using the AMIB dataset - an experience sampling study of daily social interactions, emotions, and behaviors from N = 190 college students.

Outline

  1. Introduction to the Research Questions, Model, and Data.
  2. Descriptives, Plotting, and Data preparation.
  3. Two-level OWM model.
  4. Three-level OWM model.
  5. Cautions and Conclusion.

1. Introduction to the Research Questions, Model, and Data.

The Research Questions.

We are going to address:

  • In the two-level model:

    • Is focal person extraversion associated with focal persons’ or partners’ reports of communion? This will be addressed by examining the fixed effects.

    • How much variability in communion (i.e., interpersonal warmth) reported after a social interaction is due to (1) differences between dyads within focal persons and (2) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partner view communion with their focal person similarly? These questions will be addressed by examining the random effects of the model.

    • Are there unique relationship effects between focal persons and partners - i.e., are there components of the relationship not accounted for by how the focal person views all of their partners and how all of the partners view the focal person? This will be addressed by examining the residual terms.

  • In the three-level model:

    • Is perceived partner dominance during an interaction associated with focal persons’ or partners’ reports of communion? This will be addressed by examining the fixed effects.

    • Is focal person extraversion associated with focal persons’ or partners’ reports of communion? Furthermore, does focal person extraversion moderate the association between perceptions of communion and dominance during a social interaction? This will be addressed by examining the fixed effects.

    • How much variability in communion (i.e., interpersonal warmth) reported after a social interaction is due to (1) differences within dyads, (2) differences between dyads within focal persons, and (3) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partner view communion with their focal person similarly? These questions will be addressed by examining the random effects of the model.

    • Are there unique relationship effects between focal persons and partners - i.e., are there components of the relationship not accounted for by how the focal person views all of their partners and how all of the partners view the focal person? This will be addressed by examining the residual terms.

The Data.

The data are organized as follows:

  • We have one data set that contains person-level information collected at the baseline of the study. Since there are N (number of individuals) = 190 individuals, this data set will be 190 rows long.

  • We have another data set that contains interaction-level information. Each individual in the study reported on every interaction that lasted greater than five minutes, so we expect a varying number of reports per individual. In total, we have 7,568 rows of data.

The data sets have additional columns we will not use, so we will subset to only the variables we need. Specifically…

  • Participant ID (id)
  • Day (i.e., day in study; day)
  • Interaction (i.e., interaction number; interaction)
  • Partner type (i.e., categorical label for interaction partner, including friends, strangers, etc.; partner_status)
  • Big Five Inventory: Extraversion (bfi_e)
  • Partner communion (igaff)
  • Partner dominance (igdom)
  • Focal person communion (sbi_commun)

  • for a total of 8 columns in this data set

Before we begin, let’s load the libraries we need and data we are going to use.

library(dplyr)    #for data manipulation
library(ggplot2)  #for plotting
library(nlme)     #for mlm analysis
library(psych)    #for descriptives
library(reshape2) #for data manipulation

Load the data.

# Set filepath for person-level data file
filepath <- "https://quantdev.ssri.psu.edu/sites/qdev/files/AMIBshare_persons_2019_0501.csv"

# Read in the .csv file using the url() function
amib_person <- read.csv(file = url(filepath), header = TRUE)

# Set filepath for interaction level data file
filepath1 <- "https://quantdev.ssri.psu.edu/sites/qdev/files/AMIBshare_interaction_2019_0501.csv" 

# Read in the .csv file using the url() function
amib_interaction <- read.csv(file = url(filepath1), header = TRUE)

# Merge daily and person-level data
amib <- merge(amib_person, amib_interaction, by = "id")

Subset to our variables of interest.

amib <- amib[ , c("id", "day", "interaction", "partner_status", 
                  "igaff", "igdom", "sbi_commun", "bfi_e")]

Create a variable within each partner type that counts the number of interactions with that partner type.

amib <- amib %>%
        group_by(id, partner_status) %>%
        mutate(int_count = 1:(n())) %>%
        as.data.frame()

head(amib)
##    id day interaction partner_status igaff igdom sbi_commun bfi_e
## 1 101   1           1             NA     7     6         -1   3.5
## 2 101   1           2              4     8     6          0   3.5
## 3 101   1           3              4     8     6          1   3.5
## 4 101   1           4              4     9     8          1   3.5
## 5 101   1           5              9     4     5          0   3.5
## 6 101   1           6              4     8     7          0   3.5
##   int_count
## 1         1
## 2         1
## 3         2
## 4         3
## 5         1
## 6         4

2. Descriptives, Plotting, and Data Preparation.

Descriptives.

Before beginning our analyses, it is often useful to get to know the data we are working with. So, we start by describing the number of social interactions for each participant and number of social interactions per day for each participant.

Number of social interactions per participant.

int_count <- amib %>%
             group_by(id) %>% 
             summarise(num_interactions = length(interaction)) %>%
             as.data.frame()

describe(int_count$num_interactions)
##    vars   n  mean    sd median trimmed   mad min max range  skew kurtosis
## X1    1 184 41.13 13.62     43   42.45 17.79  10  56    46 -0.53    -0.94
##    se
## X1  1

On average, each participant had a total of 41.13 social interactions (SD = 13.62) over the course of the eight-day study, ranging from a minimum of 10 social interactions to a maximum of 56 social interactions that lasted over five minutes.

Number of social interactions per person per day.

int_count_day <- amib %>%
                 group_by(id, day) %>%
                 summarise(num_interactions = length(interaction)) %>%
                 as.data.frame()

describe(int_count_day$num_interactions)
##    vars    n mean   sd median trimmed  mad min max range  skew kurtosis
## X1    1 1255 6.03 2.12      7    6.28 1.48   1   8     7 -0.63     -0.9
##      se
## X1 0.06

On average, each participant had a total of 6.03 social interactions (SD = 2.12) each day over the course of the eight-day study, ranging from a minimum of 1 social interactions to a maximum of 8 social interactions each day that lasted over five minutes.

Next, let’s examine our outcome (focal person communion = sbi_commun; partner communion = igaff) and predictor (focal person extraversion = bfi_e; partner dominance = igdom) variables.

#focal person communion
describe(amib$sbi_commun)
##    vars    n mean   sd median trimmed  mad min max range  skew kurtosis
## X1    1 7568 0.87 1.06      1     0.9 1.48  -3   3     6 -0.23      0.1
##      se
## X1 0.01
ggplot(data = amib, aes(x = sbi_commun)) + 
  geom_histogram(binwidth = 0.5) +
  xlab("Focal Person Communion") +
  theme_classic()

#partner communion
describe(amib$igaff)
##    vars    n mean   sd median trimmed  mad min max range  skew kurtosis
## X1    1 7554 7.06 1.76      7    7.31 1.48   1   9     8 -1.16     1.11
##      se
## X1 0.02
ggplot(data = amib, aes(x = igaff)) + 
  geom_histogram(binwidth = 0.5) +
  xlab("Partner Communion") +
  theme_classic()
## Warning: Removed 14 rows containing non-finite values (stat_bin).

#focal person extraversion
describe(amib$bfi_e)
##    vars    n mean   sd median trimmed  mad min max range  skew kurtosis
## X1    1 7568 3.41 0.97    3.5    3.43 0.74   1   5     4 -0.24    -0.52
##      se
## X1 0.01
ggplot(data = amib, aes(x = bfi_e)) + 
  geom_histogram(binwidth = 0.25) +
  xlab("Focal Person Extraversion") +
  theme_classic()

#partner dominance
describe(amib$igdom)
##    vars    n mean   sd median trimmed  mad min max range  skew kurtosis
## X1    1 7553 6.74 1.67      7     6.9 1.48   1   9     8 -0.83     0.44
##      se
## X1 0.02
ggplot(data = amib, aes(x = igdom)) + 
  geom_histogram(binwidth = 0.5) +
  xlab("Partner Dominance") +
  theme_classic()
## Warning: Removed 15 rows containing non-finite values (stat_bin).

Data Preparation.

Currently, our data are in a “long” format (i.e., there is a single row for each occasion in the data set). Because this data set was not originally structured as a study of dyads, we are going to manipulate our data in order to mimic dyadic data.

First, let’s double check the structure of our variables. We want to make sure the “partner_status” variable is a factor variable.

str(amib)
## 'data.frame':    7568 obs. of  9 variables:
##  $ id            : int  101 101 101 101 101 101 101 101 101 101 ...
##  $ day           : int  1 1 1 1 1 1 1 1 2 2 ...
##  $ interaction   : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ partner_status: int  NA 4 4 4 9 4 4 4 5 4 ...
##  $ igaff         : num  7 8 8 9 4 8 8 8 7 8 ...
##  $ igdom         : num  6 6 6 8 5 7 7 7 6 7 ...
##  $ sbi_commun    : int  -1 0 1 1 0 0 1 0 -1 1 ...
##  $ bfi_e         : num  3.5 3.5 3.5 3.5 3.5 3.5 3.5 3.5 3.5 3.5 ...
##  $ int_count     : int  1 1 2 3 1 4 5 6 1 7 ...

Looks like we need to change “partner_status” to a factor variable.

amib$partner_status <- as.factor(amib$partner_status)

For the sake of this tutorial, remove rows in which information about the partner is missing.

amib <- amib[complete.cases(amib[ , "partner_status"]),]

Then, we will have to re-do the interaction count (int_count) variable to re-count the interactions now that we removed the missing data.

amib <- amib %>%
        group_by(id) %>%
        mutate(interaction = 1:length(interaction)) %>%
        as.data.frame()

Next, we’re going to do a bit of data management and “fudge” the data in a way so it is dyadic.

Repeat each row twice, so we can have a row for each member of the “dyad” at each interaction.

amib <- amib[rep(seq_len(nrow(amib)), each=2),]

Create variables to indicate whether the row is a focal person or partner.
Specifically:

  • focalcode = 1 if data are from the focal person and 0 if the data are from partner
  • partcode = 1 if data are from partner and 0 if data are from the focal person
even_indexes <- seq(2, nrow(amib), 2)
odd_indexes<-seq(1, nrow(amib) - 1, 2)

# Focal person
amib$focalcode <- 0
amib[odd_indexes, "focalcode"] <- 1

# Partner
amib$partcode <- 1
amib[odd_indexes, "partcode"] <- 0

head(amib)
##      id day interaction partner_status igaff igdom sbi_commun bfi_e
## 1   101   1           1              4     8     6          0   3.5
## 1.1 101   1           1              4     8     6          0   3.5
## 2   101   1           2              4     8     6          1   3.5
## 2.1 101   1           2              4     8     6          1   3.5
## 3   101   1           3              4     9     8          1   3.5
## 3.1 101   1           3              4     9     8          1   3.5
##     int_count focalcode partcode
## 1           1         1        0
## 1.1         1         0        1
## 2           2         1        0
## 2.1         2         0        1
## 3           3         1        0
## 3.1         3         0        1

Self and partner communion are on different scales, so we will standardize these for the sake of interpretation.

amib$self_comm <- scale(amib$igaff)
amib$partner_comm <- scale(amib$sbi_commun)

Extraversion (bfi_e) should be also centered before analysis so that the intercept terms indicate expected value for an average person rather than for a person with bfi_e = 0 (who does not exist in the data).

amib$bfi_e_c <- scale(amib$bfi_e, center = TRUE, scale = FALSE)

Create a new outcome variable for communion, such that one column alternates between self and partner reports of commuion. Make sure that self communion reports are in rows where the focal person dummy variable (focalcode) is equal to one, and that the partner communion reports are in rows where the partner person dummy variable (partcode) is equal to one.

amib$communion[amib$focalcode == 1] <- amib$self_comm[amib$focalcode == 1]

amib$communion[amib$partcode == 1] <- amib$partner_comm[amib$partcode == 1]

head(amib)
##      id day interaction partner_status igaff igdom sbi_commun bfi_e
## 1   101   1           1              4     8     6          0   3.5
## 1.1 101   1           1              4     8     6          0   3.5
## 2   101   1           2              4     8     6          1   3.5
## 2.1 101   1           2              4     8     6          1   3.5
## 3   101   1           3              4     9     8          1   3.5
## 3.1 101   1           3              4     9     8          1   3.5
##     int_count focalcode partcode self_comm partner_comm    bfi_e_c
## 1           1         1        0 0.5143292   -0.8317975 0.08693182
## 1.1         1         0        1 0.5143292   -0.8317975 0.08693182
## 2           2         1        0 0.5143292    0.1119341 0.08693182
## 2.1         2         0        1 0.5143292    0.1119341 0.08693182
## 3           3         1        0 1.0914917    0.1119341 0.08693182
## 3.1         3         0        1 1.0914917    0.1119341 0.08693182
##      communion
## 1    0.5143292
## 1.1 -0.8317975
## 2    0.5143292
## 2.1  0.1119341
## 3    1.0914917
## 3.1  0.1119341

I think the data are ready for modeling!

Plotting.

Before modeling, it can also be helpful to plot the data to understand between- and within-individual differences.

Plot focal persons’ and partners’ reports of communion over time for a subset of participants.

ggplot() + 
  geom_rect(data = amib[which(amib$id < 111), ], 
            aes(xmin = interaction - .5, xmax = interaction + .5, ymin = -5, ymax = 5, 
                fill = as.factor(partner_status))) +
  geom_line(data = amib[which(amib$id < 111), ], aes(x = interaction, y = partner_comm), size = 1) +
  geom_line(data = amib[which(amib$id < 111), ], aes(x = interaction, y = self_comm), 
            color = "white", size = 1) +
  xlab("Interaction Number") +
  ylab("Partner Reports of Communion = Black\nFocal Person Reports of Communion = White") +
  facet_wrap( ~ id) +
  scale_fill_discrete(name="Partner Type") +
  theme_classic() +
  theme(axis.text.y=element_blank())

3. Two-level OWM model.

We’ll construct a model examining differences in partners’ and focal persons’ reports of communion (communion) by focal person extraversion (bfi_e) - not distinguishing by partner type.

We use the two dummy variables (focalcode and partcode) to turn on and off the parameters. The parameters invoked with \(focalcode\) are associated with the focal persons’ reports of communion, and parameters invoked with \(partcode\) are associated with the partners’ reports of communion.

Level 1 of the multilevel model is as follows:

\[Communion_{FPdi} = \gamma_{0Fi}Focal_{di} + \gamma_{0Pi}Partner_{di} + e_{Fdi} +e_{Pdi}\]

And Level 2 of the multilevel model: \[\gamma_{0Fi} = \pi_{00F} + \pi_{01F}FocalExtraversion_{i} + v_{0Fi} \\ \gamma_{0Pi} = \pi_{00P} + \pi_{01P}FocalExtraversion_{i} + v_{0Pi}\]

Noting that our random effect matrices also expand, \[\mathbf{R} = \left[\begin{array} & \sigma^2_{eFdi} & \sigma_{eFdiePdi} \\ \sigma_{eFdiePdi} & \sigma^2_{ePdi} \end{array}\right]\]

where \(\sigma_{eFdiePdi}\) is the residual covariance between focal person and partner communion.
and \[\left[\begin{array} {rrrr} \sigma^{2}_{v0Fi} & \sigma_{v0Fiv0Pi} \\ \sigma_{v0Fiv0Pi} & \sigma^{2}_{v0Pi} \\ \end{array}\right]\]

where the matrix is blocks of between-focal person associations. These are sample-level, between-dyad relations, and should be interpreted appropriately.

We are going to take a subset of our data to make cross-sectional data. So, we’ll select the first social interaction with each partner type for each participant.

two_level <- amib %>%
             group_by(id, partner_status) %>%
             filter(row_number() == 1 | row_number() == 2) %>%
             group_by(id) %>%
             mutate(measurement = rep(1:(n()/2), each = 2)) %>%
             as.data.frame()

head(two_level)
##    id day interaction partner_status igaff igdom sbi_commun bfi_e
## 1 101   1           1              4     8     6          0   3.5
## 2 101   1           1              4     8     6          0   3.5
## 3 101   1           4              9     4     5          0   3.5
## 4 101   1           4              9     4     5          0   3.5
## 5 101   2           8              5     7     6         -1   3.5
## 6 101   2           8              5     7     6         -1   3.5
##   int_count focalcode partcode   self_comm partner_comm    bfi_e_c
## 1         1         1        0  0.51432924   -0.8317975 0.08693182
## 2         1         0        1  0.51432924   -0.8317975 0.08693182
## 3         1         1        0 -1.79432077   -0.8317975 0.08693182
## 4         1         0        1 -1.79432077   -0.8317975 0.08693182
## 5         1         1        0 -0.06283326   -1.7755290 0.08693182
## 6         1         0        1 -0.06283326   -1.7755290 0.08693182
##     communion measurement
## 1  0.51432924           1
## 2 -0.83179748           1
## 3 -1.79432077           2
## 4 -0.83179748           2
## 5 -0.06283326           3
## 6 -1.77552903           3

Before we test our research question, we run an empty model in order to calculate the intra-class correlation (ICC), which will tell us how much variance is attributable to between partner within-focal person differences and between-focal person differences.

Fit empty two-level model for communion.

ctrl <- lmeControl(opt='optim')

empty_2level <- lme(fixed = communion ~ 
                                 -1 +
                                 focalcode + 
                                 partcode,
                        random = ~ -1 + focalcode + partcode | id, #the -1 makes sure no intercept is estimated
                        weights = varIdent(form = ~1 | focalcode),
                        corr = corCompSymm(form = ~1 | id/focalcode),
                        control = ctrl,
                        data = two_level,
                        na.action=na.exclude) 

summary(empty_2level)
## Linear mixed-effects model fit by REML
##  Data: two_level 
##        AIC      BIC    logLik
##   4602.577 4645.463 -2293.288
## 
## Random effects:
##  Formula: ~-1 + focalcode + partcode | id
##  Structure: General positive-definite, Log-Cholesky parametrization
##           StdDev    Corr  
## focalcode 0.3222327 foclcd
## partcode  0.2695820 0.409 
## Residual  0.9492075       
## 
## Correlation Structure: Compound symmetry
##  Formula: ~1 | id/focalcode 
##  Parameter estimate(s):
##         Rho 
## -0.04293804 
## Variance function:
##  Structure: Different standard deviations per stratum
##  Formula: ~1 | focalcode 
##  Parameter estimates:
##        0        1 
## 1.000000 1.099064 
## Fixed effects: communion ~ -1 + focalcode + partcode 
##                Value  Std.Error   DF    t-value p-value
## focalcode -0.1232275 0.04211559 1390 -2.9259348  0.0035
## partcode   0.0209606 0.03728380 1390  0.5621905  0.5741
##  Correlation: 
##          foclcd
## partcode 0.131 
## 
## Standardized Within-Group Residuals:
##         Min          Q1         Med          Q3         Max 
## -3.24729365 -0.65972810  0.09454806  0.72936631  2.34005446 
## 
## Number of Observations: 1575
## Number of Groups: 184

Obtain ICC.

VarCorr(empty_2level)
## id = pdLogChol(-1 + focalcode + partcode) 
##           Variance   StdDev    Corr  
## focalcode 0.10383394 0.3222327 foclcd
## partcode  0.07267445 0.2695820 0.409 
## Residual  0.90099493 0.9492075
var_output <- as.numeric(VarCorr(empty_2level))
## Warning: NAs introduced by coercion
var_output
## [1] 0.10383394 0.07267445 0.90099493 0.32223270 0.26958200 0.94920750
## [7]         NA 0.40900000         NA
level2_icc <- (var_output[1] + var_output[2]) / (var_output[1] + var_output[2] + var_output[3])
level2_icc
## [1] 0.1638124

From the unconditional means model, the ICC was calculated, which indicated that of the total variance in communion, 16.4% is attributable to between-focal person variation whereas 83.6% is attributatable to within-focal person between-partner variation.

Now, we run our model of interest: examining differences in partners’ and focal persons’ reports of communion (communion) by focal person extraversion (bfi_e) - not distinguishing by partner type.

ctrl <- lmeControl(opt='optim')

model_2level <- lme(fixed = communion ~ 
                                 -1 +
                                 focalcode + 
                                 partcode + 
                                 focalcode:bfi_e_c + 
                                 partcode:bfi_e_c,
                        random = ~ -1 + focalcode + partcode | id, #the -1 makes sure no intercept is estimated
                        weights = varIdent(form = ~1 | focalcode),
                        corr = corCompSymm(form = ~1 | id/focalcode),
                        control = ctrl,
                        data = two_level,
                        na.action=na.exclude) 

summary(model_2level)
## Linear mixed-effects model fit by REML
##  Data: two_level 
##        AIC      BIC    logLik
##   4615.597 4669.192 -2297.799
## 
## Random effects:
##  Formula: ~-1 + focalcode + partcode | id
##  Structure: General positive-definite, Log-Cholesky parametrization
##           StdDev    Corr  
## focalcode 0.3236974 foclcd
## partcode  0.2709433 0.408 
## Residual  0.9494986       
## 
## Correlation Structure: Compound symmetry
##  Formula: ~1 | id/focalcode 
##  Parameter estimate(s):
##         Rho 
## -0.04233659 
## Variance function:
##  Structure: Different standard deviations per stratum
##  Formula: ~1 | focalcode 
##  Parameter estimates:
##        0        1 
## 1.000000 1.099058 
## Fixed effects: communion ~ -1 + focalcode + partcode + focalcode:bfi_e_c + partcode:bfi_e_c 
##                         Value  Std.Error   DF    t-value p-value
## focalcode         -0.12377253 0.04226193 1388 -2.9287007  0.0035
## partcode           0.02047645 0.03741858 1388  0.5472268  0.5843
## focalcode:bfi_e_c -0.01485689 0.04261544 1388 -0.3486270  0.7274
## partcode:bfi_e_c  -0.01149355 0.03774054 1388 -0.3045411  0.7608
##  Correlation: 
##                   foclcd partcd fcl:__
## partcode          0.131               
## focalcode:bfi_e_c 0.043  0.005        
## partcode:bfi_e_c  0.005  0.044  0.127 
## 
## Standardized Within-Group Residuals:
##         Min          Q1         Med          Q3         Max 
## -3.25389432 -0.65321977  0.08885428  0.73307104  2.34815916 
## 
## Number of Observations: 1575
## Number of Groups: 184

Brief Interpretation of the Results

Going back to the original research questions outlined at the beginning of the tutorial…

  • Is focal person extraversion associated with focal persons’ or partners’ reports of communion?

    • The association between focal persons extraversion and focal person reports of communion (\(\pi_{01F}\)) is -0.01 and is not significantly different from zero. Furthermore, the association between focal persons’ extraversion and partner reports of communion (\(\pi_{01P}\)) is -0.01 and is not significantly different from zero.
  • How much variability in communion (i.e., interpersonal warmth) reported after a social interaction is due to (1) differences between dyads within focal persons and (2) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partner view communion with their focal person similarly?

    • The standard deviation around focal person (\(\sigma_{v0Fi}\)) and partners (\(\sigma_{v0Pi}\)) reports of communion is 0.32 and 0.27, respectively. Additionally, focal person and partners reports of communion are correlated 0.41, indicating that members of the same dyad often have relatively similar reports of communion.
  • Are there unique relationship effects between focal persons and partners - i.e., are there components of the relationship not accounted for by how the focal person views all of their partners and how all of the partners view the focal person?

    • The standard deviation around the focal person residual (\(\sigma_{eF}\)) is 0.95 and the standard deviation around the partner residual (\(\sigma_{eP}\)) is 1.04 (0.949 * 1.099), indicating unique relationship effects.

Plotting the results.

Calculate estimates for focal persons and partners at +/- 1SD for centered extraversion for focal persons and partners.

# Find -1 and +1 SD of extraversion
describe(amib$bfi_e_c)
##    vars     n mean   sd median trimmed  mad   min  max range  skew
## X1    1 14080    0 0.97   0.09    0.02 0.74 -2.41 1.59     4 -0.23
##    kurtosis   se
## X1    -0.54 0.01
# Points at which to estimate communion
extraversion <- c(-0.97, 0, 0.97)

# Calculate communion for each focal person and partner +/- 1SD extraversion
fp_est <- -0.12 + -0.01*extraversion 

p_est <- 0.02 + -0.01*extraversion 

# Combine all of these into one vector
fit_estimates <- c(fp_est, p_est)

Build a data set that contains the predicted values.

# Focal person / partner label
focal_partner <- rep(c("Focal Person", "Partner"), each = 3)

# Extraversion levels
extraversion_repeat <- rep(c(-0.97, 0, 0.97), 2)

plot_data <- data.frame(focal_partner = focal_partner, extraversion = extraversion_repeat, fit_estimates)

Plot.

ggplot(plot_data, aes(x = extraversion, y = fit_estimates, 
                      color = focal_partner, group = focal_partner)) + 
    geom_line(size = 1) +
    labs(title = "Extraversion-Communion Association", 
         x = "Extraversion", y = "Communion", 
         color = "Person", fill = "Person", size = 12) + 
  ylim(-2, 2) +
  theme_classic() + 
  theme(text=element_text(size=12)) +
  theme(plot.title = element_text(hjust = 0.5))

4. Three-level OWM model.

Next, we are going to run the three-level OWM model which incorporates the repeated measures for each partner type and allows us to examine within-dyad processes. Specifically, we’ll construct a model examining the focal person, partner, and relationship effects of communion during social interactions with different types of partners (partner_status), and whether the perceived partner dominance during the interaction (igdom) or the extraversion of the focal person (bfi_e) were associated with reports of communion (communion).

We use the two dummy variables (focalcode and partcode) to turn on and off the parameters. The parameters invoked with \(focalcode\) are associated with the focal persons’ reports of communion, and parameters invoked with \(partcode\) are associated with the partners’ reports of communion.

Level 1 of the multilevel model is as follows:

\[Communion_{FPtdi} = \beta_{0Fdi}Focal_{tdi} + \beta_{0Pdi}Partner_{tdi} + \\ \beta_{1Fdi}Focal_{tdi}*PartnerDominance_{tdi} + \beta_{1Pdi}Partner_{tdi}*PartnerDominance_{tdi} + \\ e_{Ftdi} +e_{Ptdi}\]

And Level 2 of the multilevel model:

\[\beta_{0Fdi} = \gamma_{00FPi}FocalParent_{di} + \gamma_{00FFri}FocalFriend_{di} + ... + \gamma_{00FRi}FocalRoommate_{di} + u_{0Fdi} \\ \beta_{0Pdi} = \gamma_{00PFi}FocalParent_{di} + \gamma_{00FrFi}FocalFriend_{di} + ... + \gamma_{00RFi}FocalRoommate_{di} + u_{0Pdi} \\ \beta_{1Fdi} = \gamma_{10FPi}FocalParent_{di} + \gamma_{10FFri}FocalFriend_{di} + ... + \gamma_{10FRi}FocalRoommate_{di} \\ \beta_{1Pdi} = \gamma_{10PFi}FocalParent_{di} + \gamma_{10FrFi}FocalFriend_{di} + ... + \gamma_{10RFi}FocalRoommate_{di} \]

Finally, Level 3 of the multilevel model:

\[\gamma_{00FPi} = \pi_{000FP} + \pi_{001FP}FocalExtraversion_{i} + v_{00FPi} \\ \gamma_{00FFri} = \pi_{000FFr} + \pi_{001FFr}FocalExtraversion_{i} \\ ... \\ \gamma_{00FRi} = \pi_{000FR} + \pi_{001FR}FocalExtraversion_{i} \\ \gamma_{00PFi} = \pi_{000PF} + \pi_{001PF}FocalExtraversion_{i} + v_{00PFi} \\ \gamma_{00FrFi} = \pi_{000FrF} + \pi_{001FrF}FocalExtraversion_{i} \\ ... \\ \gamma_{10FPi} = \pi_{100FP} + \pi_{011FP}FocalExtraversion_{i} \\ \gamma_{10FFri} = \pi_{100FFr} + \pi_{011FFr}FocalExtraversion_{i} \\ ... \\ \gamma_{10FRi} = \pi_{100FR} + \pi_{011FR}FocalExtraversion_{i} \\ \gamma_{10PFi} = \pi_{100PF} + \pi_{011PF}FocalExtraversion_{i} \\ \gamma_{10FrFi} = \pi_{100FrF} + \pi_{011FrF}FocalExtraversion_{i} \\ ... \\ \gamma_{10RFi} = \pi_{100RF} + \pi_{011RF}FocalExtraversion_{i}\]

Finally, the covariance structure of the three-level OWM model follows the same pattern as the random effects structure presented for the two-level OWM model, except there is an additional 2 x 2 matrix that contains the variances and covariances of the random effects at the third level.

Before we test our research question, we run an empty model in order to calculate the intra-class correlation (ICC), which will tell us how much variance is attributable to each level - in this case, within partners, within focal persons, and between focal persons.

Fit empty three-level model for communion.

ctrl <- lmeControl(opt='optim')

empty_3level <- lme(fixed = communion ~ 
                                 -1 +
                                 focalcode + 
                                 partcode,
                        random = ~ -1 + focalcode + partcode | id/partner_status, 
                        weights = varIdent(form = ~1 | focalcode),
                        corr = corCompSymm(form = ~1 | id/partner_status),
                        control = ctrl,
                        data = amib,
                        na.action = na.exclude) 

summary(empty_3level)
## Linear mixed-effects model fit by REML
##  Data: amib 
##     AIC      BIC logLik
##   38250 38333.06 -19114
## 
## Random effects:
##  Formula: ~-1 + focalcode + partcode | id
##  Structure: General positive-definite, Log-Cholesky parametrization
##           StdDev    Corr  
## focalcode 0.3379705 foclcd
## partcode  0.3040516 -0.022
## 
##  Formula: ~-1 + focalcode + partcode | partner_status %in% id
##  Structure: General positive-definite, Log-Cholesky parametrization
##           StdDev    Corr  
## focalcode 0.4420893 foclcd
## partcode  0.2637700 0.917 
## Residual  0.8675389       
## 
## Correlation Structure: Compound symmetry
##  Formula: ~1 | id/partner_status 
##  Parameter estimate(s):
##          Rho 
## -0.008077637 
## Variance function:
##  Structure: Different standard deviations per stratum
##  Formula: ~1 | focalcode 
##  Parameter estimates:
##        1        0 
## 1.000000 1.063341 
## Fixed effects: communion ~ -1 + focalcode + partcode 
##                 Value  Std.Error    DF   t-value p-value
## focalcode -0.07610935 0.03282504 13278 -2.318637  0.0204
## partcode  -0.03755855 0.02748390 13278 -1.366565  0.1718
##  Correlation: 
##          foclcd
## partcode 0.179 
## 
## Standardized Within-Group Residuals:
##        Min         Q1        Med         Q3        Max 
## -4.5924704 -0.5484729  0.1003602  0.6389923  2.8551207 
## 
## Number of Observations: 14067
## Number of Groups: 
##                     id partner_status %in% id 
##                    184                    788

Obtain ICCs.

VarCorr(empty_3level)
##                  Variance                             StdDev    Corr  
## id =             pdLogChol(-1 + focalcode + partcode)                 
## focalcode        0.11422408                           0.3379705 foclcd
## partcode         0.09244735                           0.3040516 -0.022
## partner_status = pdLogChol(-1 + focalcode + partcode)                 
## focalcode        0.19544299                           0.4420893 foclcd
## partcode         0.06957464                           0.2637700 0.917 
## Residual         0.75262371                           0.8675389
var_output <- as.numeric(VarCorr(empty_3level))
## Warning: NAs introduced by coercion
var_output
##  [1]          NA  0.11422408  0.09244735          NA  0.19544299
##  [6]  0.06957464  0.75262371          NA  0.33797050  0.30405160
## [11]          NA  0.44208930  0.26377000  0.86753890          NA
## [16]          NA -0.02200000          NA          NA  0.91700000
## [21]          NA
# Level 2 ICC is calculated as variance of level 2 and 3 over total variance
level2_icc <- (var_output[2] + var_output[3] + var_output[5] + var_output[6]) / 
              (var_output[2] + var_output[3] + var_output[5] + var_output[6] + var_output[7])
level2_icc
## [1] 0.3852684
# Level 3 ICC is calculated as variance of level 3 over variance of level 2 & 3
level3_icc <- (var_output[5] + var_output[6]) / 
              (var_output[2] + var_output[3] + var_output[5] + var_output[6])
level3_icc
## [1] 0.5618482

From the three-level unconditional means model, the Level-2 ICC was calculated, which indicated that of the total variance in communion, 38.5% is attributable to between partners within a focal person variation. Furthermore, the Level-3 ICC was calculated, which indicated that 56.1% is attributatable to between focal person variation.

Examining the focal person, partner, and relationship effects of communion during social interactions with different types of partners, and whether the perceived partner dominance during the interaction or the extraversion of the focal person were associated with reports of communion.

ctrl <- lmeControl(opt='optim')

model_3level <- lme(fixed = communion ~ 
                            -1 +
                            focalcode:partner_status +
                            partcode:partner_status + 
                            focalcode:igdom:partner_status +
                            partcode:igdom:partner_status +
                            focalcode:bfi_e_c:partner_status + 
                            partcode:bfi_e_c:partner_status + 
                            focalcode:bfi_e_c:partner_status:igdom + 
                            partcode:bfi_e_c:partner_status:igdom,
                        random = ~ -1 + focalcode + partcode | id/partner_status, 
                        weights = varIdent(form = ~1 | focalcode),
                        corr = corCompSymm(form = ~1 | id/partner_status),
                        control = ctrl,
                        data = amib,
                        na.action = na.exclude) 

#summary(model_3level)

# Fixed Effects
summary(model_3level)$tTable
##                                                Value   Std.Error    DF
## focalcode:partner_status1               -0.769276904 0.309746040 13193
## focalcode:partner_status2               -1.027464257 0.327465746 13193
## focalcode:partner_status3               -0.946121243 1.295306207 13193
## focalcode:partner_status4               -0.909257028 0.073575997 13193
## focalcode:partner_status5               -0.863798091 0.143908070 13193
## focalcode:partner_status6               -1.639306634 0.178658814 13193
## focalcode:partner_status7               -0.480225479 0.394004826 13193
## focalcode:partner_status8               -1.174997314 0.470170246 13193
## focalcode:partner_status9               -1.484728204 0.106034906 13193
## partner_status1:partcode                -0.046489013 0.324351060 13193
## partner_status2:partcode                 0.198447329 0.337069012 13193
## partner_status3:partcode                 0.082408906 1.345641016 13193
## partner_status4:partcode                -0.178504925 0.075705303 13193
## partner_status5:partcode                -0.132447647 0.149831438 13193
## partner_status6:partcode                -0.656248095 0.182887238 13193
## partner_status7:partcode                 0.012754374 0.411834318 13193
## partner_status8:partcode                 0.169608652 0.493736246 13193
## partner_status9:partcode                -0.384835492 0.109658369 13193
## focalcode:partner_status1:igdom          0.047316016 0.041692975 13193
## focalcode:partner_status2:igdom          0.132623029 0.048956072 13193
## focalcode:partner_status3:igdom          0.010740566 0.168419997 13193
## focalcode:partner_status4:igdom          0.146232385 0.009212123 13193
## focalcode:partner_status5:igdom          0.105190420 0.020987350 13193
## focalcode:partner_status6:igdom          0.260264626 0.024558956 13193
## focalcode:partner_status7:igdom          0.069806805 0.052331786 13193
## focalcode:partner_status8:igdom          0.199108625 0.065113731 13193
## focalcode:partner_status9:igdom          0.198215145 0.015209186 13193
## partner_status1:partcode:igdom          -0.009093224 0.043832763 13193
## partner_status2:partcode:igdom          -0.036974956 0.050320313 13193
## partner_status3:partcode:igdom          -0.035454269 0.174058605 13193
## partner_status4:partcode:igdom           0.035922720 0.009939798 13193
## partner_status5:partcode:igdom           0.010709675 0.022267980 13193
## partner_status6:partcode:igdom           0.097688070 0.025472385 13193
## partner_status7:partcode:igdom           0.006565948 0.055275887 13193
## partner_status8:partcode:igdom          -0.013803355 0.068462039 13193
## partner_status9:partcode:igdom           0.032281232 0.016016831 13193
## focalcode:partner_status1:bfi_e_c        0.163678952 0.280372281 13193
## focalcode:partner_status2:bfi_e_c        0.115852986 0.330386871 13193
## focalcode:partner_status3:bfi_e_c        3.080992673 1.333636572 13193
## focalcode:partner_status4:bfi_e_c        0.138167388 0.071915592 13193
## focalcode:partner_status5:bfi_e_c        0.404977498 0.149624937 13193
## focalcode:partner_status6:bfi_e_c       -0.337806824 0.189001498 13193
## focalcode:partner_status7:bfi_e_c        0.688796637 0.470757977 13193
## focalcode:partner_status8:bfi_e_c       -1.158103808 0.465733687 13193
## focalcode:partner_status9:bfi_e_c        0.291438066 0.109006784 13193
## partner_status1:partcode:bfi_e_c         0.391201777 0.293756313 13193
## partner_status2:partcode:bfi_e_c        -0.312323264 0.338925365 13193
## partner_status3:partcode:bfi_e_c        -0.091148644 1.387877875 13193
## partner_status4:partcode:bfi_e_c         0.196016955 0.074137678 13193
## partner_status5:partcode:bfi_e_c         0.266677370 0.157586241 13193
## partner_status6:partcode:bfi_e_c         0.027903420 0.195390175 13193
## partner_status7:partcode:bfi_e_c        -0.391353133 0.502340428 13193
## partner_status8:partcode:bfi_e_c         0.134444646 0.489334731 13193
## partner_status9:partcode:bfi_e_c         0.193893284 0.113140915 13193
## focalcode:partner_status1:igdom:bfi_e_c -0.044922347 0.037469799 13193
## focalcode:partner_status2:igdom:bfi_e_c -0.000746536 0.052061534 13193
## focalcode:partner_status3:igdom:bfi_e_c -0.459604849 0.176316949 13193
## focalcode:partner_status4:igdom:bfi_e_c -0.018858981 0.009048655 13193
## focalcode:partner_status5:igdom:bfi_e_c -0.078160577 0.021960944 13193
## focalcode:partner_status6:igdom:bfi_e_c  0.062246391 0.026307333 13193
## focalcode:partner_status7:igdom:bfi_e_c -0.067170046 0.062974908 13193
## focalcode:partner_status8:igdom:bfi_e_c  0.165263169 0.064392391 13193
## focalcode:partner_status9:igdom:bfi_e_c -0.042446179 0.015480037 13193
## partner_status1:partcode:igdom:bfi_e_c  -0.059103620 0.039477741 13193
## partner_status2:partcode:igdom:bfi_e_c   0.066050196 0.053434554 13193
## partner_status3:partcode:igdom:bfi_e_c   0.034730153 0.182447971 13193
## partner_status4:partcode:igdom:bfi_e_c  -0.028953863 0.009805428 13193
## partner_status5:partcode:igdom:bfi_e_c  -0.045543477 0.023498043 13193
## partner_status6:partcode:igdom:bfi_e_c   0.005813516 0.027755792 13193
## partner_status7:partcode:igdom:bfi_e_c   0.036195658 0.067937600 13193
## partner_status8:partcode:igdom:bfi_e_c  -0.035132809 0.067762324 13193
## partner_status9:partcode:igdom:bfi_e_c  -0.023167185 0.016383904 13193
##                                              t-value      p-value
## focalcode:partner_status1                -2.48357301 1.301949e-02
## focalcode:partner_status2                -3.13762361 1.706983e-03
## focalcode:partner_status3                -0.73042284 4.651447e-01
## focalcode:partner_status4               -12.35806599 6.871397e-35
## focalcode:partner_status5                -6.00242983 1.994870e-09
## focalcode:partner_status6                -9.17562696 5.148292e-20
## focalcode:partner_status7                -1.21883147 2.229300e-01
## focalcode:partner_status8                -2.49908905 1.246336e-02
## focalcode:partner_status9               -14.00225893 3.129025e-44
## partner_status1:partcode                 -0.14332931 8.860323e-01
## partner_status2:partcode                  0.58874391 5.560432e-01
## partner_status3:partcode                  0.06124137 9.511679e-01
## partner_status4:partcode                 -2.35789197 1.839355e-02
## partner_status5:partcode                 -0.88397768 3.767244e-01
## partner_status6:partcode                 -3.58826621 3.340901e-04
## partner_status7:partcode                  0.03096967 9.752942e-01
## partner_status8:partcode                  0.34352076 7.312122e-01
## partner_status9:partcode                 -3.50940376 4.506096e-04
## focalcode:partner_status1:igdom           1.13486784 2.564513e-01
## focalcode:partner_status2:igdom           2.70902102 6.756916e-03
## focalcode:partner_status3:igdom           0.06377251 9.491523e-01
## focalcode:partner_status4:igdom          15.87390693 3.181737e-56
## focalcode:partner_status5:igdom           5.01208680 5.454089e-07
## focalcode:partner_status6:igdom          10.59754440 3.896172e-26
## focalcode:partner_status7:igdom           1.33392745 1.822507e-01
## focalcode:partner_status8:igdom           3.05785926 2.233706e-03
## focalcode:partner_status9:igdom          13.03259354 1.381724e-38
## partner_status1:partcode:igdom           -0.20745267 8.356596e-01
## partner_status2:partcode:igdom           -0.73479184 4.624793e-01
## partner_status3:partcode:igdom           -0.20369156 8.385977e-01
## partner_status4:partcode:igdom            3.61402914 3.025969e-04
## partner_status5:partcode:igdom            0.48094505 6.305635e-01
## partner_status6:partcode:igdom            3.83505783 1.261187e-04
## partner_status7:partcode:igdom            0.11878503 9.054475e-01
## partner_status8:partcode:igdom           -0.20162056 8.402165e-01
## partner_status9:partcode:igdom            2.01545690 4.387704e-02
## focalcode:partner_status1:bfi_e_c         0.58379149 5.593706e-01
## focalcode:partner_status2:bfi_e_c         0.35065856 7.258501e-01
## focalcode:partner_status3:bfi_e_c         2.31021909 2.089138e-02
## focalcode:partner_status4:bfi_e_c         1.92124384 5.472250e-02
## focalcode:partner_status5:bfi_e_c         2.70661766 6.805994e-03
## focalcode:partner_status6:bfi_e_c        -1.78732353 7.390816e-02
## focalcode:partner_status7:bfi_e_c         1.46316509 1.434460e-01
## focalcode:partner_status8:bfi_e_c        -2.48662237 1.290849e-02
## focalcode:partner_status9:bfi_e_c         2.67357733 7.513936e-03
## partner_status1:partcode:bfi_e_c          1.33172211 1.829745e-01
## partner_status2:partcode:bfi_e_c         -0.92151044 3.568008e-01
## partner_status3:partcode:bfi_e_c         -0.06567483 9.476377e-01
## partner_status4:partcode:bfi_e_c          2.64395864 8.203961e-03
## partner_status5:partcode:bfi_e_c          1.69226304 9.061945e-02
## partner_status6:partcode:bfi_e_c          0.14280872 8.864434e-01
## partner_status7:partcode:bfi_e_c         -0.77905960 4.359586e-01
## partner_status8:partcode:bfi_e_c          0.27474985 7.835127e-01
## partner_status9:partcode:bfi_e_c          1.71373269 8.660132e-02
## focalcode:partner_status1:igdom:bfi_e_c  -1.19889479 2.305904e-01
## focalcode:partner_status2:igdom:bfi_e_c  -0.01433949 9.885593e-01
## focalcode:partner_status3:igdom:bfi_e_c  -2.60669693 9.152305e-03
## focalcode:partner_status4:igdom:bfi_e_c  -2.08417505 3.716344e-02
## focalcode:partner_status5:igdom:bfi_e_c  -3.55907176 3.734753e-04
## focalcode:partner_status6:igdom:bfi_e_c   2.36612326 1.798983e-02
## focalcode:partner_status7:igdom:bfi_e_c  -1.06661603 2.861648e-01
## focalcode:partner_status8:igdom:bfi_e_c   2.56650152 1.028395e-02
## focalcode:partner_status9:igdom:bfi_e_c  -2.74199474 6.114963e-03
## partner_status1:partcode:igdom:bfi_e_c   -1.49713784 1.343813e-01
## partner_status2:partcode:igdom:bfi_e_c    1.23609520 2.164452e-01
## partner_status3:partcode:igdom:bfi_e_c    0.19035648 8.490327e-01
## partner_status4:partcode:igdom:bfi_e_c   -2.95284035 3.154197e-03
## partner_status5:partcode:igdom:bfi_e_c   -1.93818170 5.262236e-02
## partner_status6:partcode:igdom:bfi_e_c    0.20945234 8.340984e-01
## partner_status7:partcode:igdom:bfi_e_c    0.53277799 5.941962e-01
## partner_status8:partcode:igdom:bfi_e_c   -0.51847113 6.041383e-01
## partner_status9:partcode:igdom:bfi_e_c   -1.41402109 1.573793e-01
# Random Effects
VarCorr(model_3level)
##                  Variance                             StdDev    Corr  
## id =             pdLogChol(-1 + focalcode + partcode)                 
## focalcode        0.10327221                           0.3213599 foclcd
## partcode         0.09947915                           0.3154032 0.012 
## partner_status = pdLogChol(-1 + focalcode + partcode)                 
## focalcode        0.11011899                           0.3318418 foclcd
## partcode         0.04783254                           0.2187065 0.905 
## Residual         0.70137712                           0.8374826

Brief Interpretation of the Results

Going back to the original research questions outlined at the beginning of the tutorial…

  • Is perceived partner dominance during an interaction associated with focal persons’ or partners’ reports of communion?

    • The association between focal person communion and partner dominance during an interaction depends on the partner type. For some dyads, this association is significant (e.g., partner type 4), whereas for other dyads, this association is not significant (e.g., partner type 7).

    • The association between partner communion and partner dominance during an interaction depends on the partner type. For some dyads, this association is significant (e.g., partner type 5), whereas for other dyads, this association is not significant (e.g., partner type 8).

  • Is focal person extraversion associated with focal persons’ or partners’ reports of communion? Furthermore, does focal person extraversion moderate the association between perceptions of communion and dominance during a social interaction?

    • The association between focal person communion and focal person extraversion depends on the partner type. For some dyads, this association is significant (e.g., partner type 3), whereas for other dyads, this association is not significant (e.g., partner type 2).

    • The association between partner communion and focal person extraversion depends on the partner type. For some dyads, this association is significant (e.g., partner type 4), whereas for other dyads, this association is not significant (e.g., partner type 6).

    • Focal person extraversion moderates the association between communion and focal person dominance during an interaction for some focal person-partner dyads (e.g., partner type 3) and for some partner-focal person dyads (e.g., partner type 4).

  • How much variability in communion (i.e., interpersonal warmth) reported after a social interaction is due to (1) differences within dyads, (2) differences between dyads within focal persons, and (3) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partner view communion with their focal person similarly?

    • The standard deviation around focal person (\(\sigma_{v00Fi}\)) and partners (\(\sigma_{v00Pi}\)) reports of communion between focal persons is 0.32 and 0.32, respectively. The standard deviation around focal person (\(\sigma_{u0Fi}\)) and partners (\(\sigma_{u0Pi}\)) re