One-with-many (OWM) Tutorial
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.
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 (2022).
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.
In addition, the accompanying “OWM_Tutorial_2022August29.rmd” file contains all of the code presented in this tutorial and can be opened in RStudio (a somewhat more friendly user interface to R).
To read more about the three-level OWM see:
Brinberg, M., Ram, N., Conroy, D.E., Pincus, A.L., & Gerstorf, D. (2022). Dyadic analysis and the reciprocal one-with-many model: Extending the study of interpersonal processes with intensive longitudinal data. Psychological Methods. doi: 10.1037/met0000380
Outline
In this tutorial, we’ll cover…
- Introduction to the Research Questions and Data.
- Descriptives, Data Preparation, and Plotting.
- Two-level OWM model.
- Three-level OWM model.
- Cautions and Conclusion.
Introduction to the Research Questions 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 differences (1) between dyads within focal persons and (2) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partners 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 differences (1) within dyads, (2) between dyads within focal persons, and (3) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partners 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.
Let’s read the data into R.
We are working with two data sets in this tutorial. One data set contains repeated measures (“AMIBshare_interaction_2019_0501”), specifically the assessments of each interaction from each individual within the study. The other data set contains time-invariant data (“AMIBshare_persons_2019_0501”), such as individuals’ self-reported extraversion.
Both data sets are stored as .csv files (comma-separated values file, which can be created by saving an Excel file as a csv document) on my computer’s desktop.
# Set working directory (i.e., where your data file is stored)
# This can be done by going to the top bar of RStudio and selecting
# "Session" --> "Set Working Directory" --> "Choose Directory" -->
# finding the location of your file
setwd("~/Desktop")# Note: You can skip this line if you have
# the data file and this .rmd file stored in the same directory
# Read in the repeated measures data
<- read.csv(file = "AMIBshare_interaction_2019_0501.csv", head = TRUE, sep = ",")
amib_interaction
# View the first 10 rows of the repeated measures data
head(amib_interaction, 10)
## id day interaction timea timeb dur choice1 choice2 location partner_gender
## 1 101 1 1 700 900 60 6 3 2 0
## 2 101 1 2 1230 1330 60 2 6 3 1
## 3 101 1 3 1245 1330 10 2 6 3 1
## 4 101 1 4 1330 1417 90 1 7 5 1
## 5 101 1 5 1420 1500 15 3 5 1 1
## 6 101 1 6 1445 1600 45 2 6 2 1
## 7 101 1 7 1920 1945 30 2 6 5 1
## 8 101 1 8 2030 2145 45 2 6 1 1
## 9 101 2 9 30 200 60 4 4 2 0
## 10 101 2 10 0 300 120 2 6 2 1
## partner_status first mtone length level igaff igdom agval agarous stress
## 1 NA 0 0 3 2 7 6 3 3 1
## 2 4 0 0 2 2 8 6 8 6 1
## 3 4 0 1 2 2 8 6 8 6 1
## 4 4 0 0 6 4 9 8 8 7 1
## 5 9 0 0 96 4 4 5 6 5 1
## 6 4 0 0 6 3 8 7 8 7 1
## 7 4 0 NA 6 4 8 7 8 7 1
## 8 4 0 NA 6 4 8 7 8 7 1
## 9 5 0 1 2 2 7 6 9 5 0
## 10 4 0 1 6 4 8 7 8 6 0
## health sbi_extra sbi_agree sbi_domin sbi_quarl sbi_submi sbi_agency
## 1 3 1 0.3333333 0.0000000 0.6666667 0.0000000 0
## 2 3 0 0.3333333 0.3333333 0.3333333 0.0000000 1
## 3 3 0 0.3333333 0.3333333 0.0000000 0.0000000 1
## 4 3 0 0.3333333 0.6666667 0.0000000 0.0000000 2
## 5 3 0 0.0000000 0.0000000 0.0000000 0.3333333 -1
## 6 3 0 0.3333333 0.3333333 0.3333333 0.0000000 1
## 7 3 0 0.3333333 0.3333333 0.0000000 0.0000000 1
## 8 3 0 0.0000000 0.3333333 0.0000000 0.0000000 1
## 9 2 0 0.3333333 0.6666667 0.6666667 0.0000000 2
## 10 2 0 0.3333333 0.3333333 0.0000000 0.0000000 1
## sbi_commun sbi_total sbi_agree_ips sbi_domin_ips sbi_quarl_ips
## 1 -1 0.25000000 0.08333333 -0.25000000 0.41666667
## 2 0 0.25000000 0.08333333 0.08333333 0.08333333
## 3 1 0.16666667 0.16666667 0.16666667 -0.16666667
## 4 1 0.25000000 0.08333333 0.41666667 -0.25000000
## 5 0 0.08333333 -0.08333333 -0.08333333 -0.08333333
## 6 0 0.25000000 0.08333333 0.08333333 0.08333333
## 7 1 0.16666667 0.16666667 0.16666667 -0.16666667
## 8 0 0.08333333 -0.08333333 0.25000000 -0.08333333
## 9 -1 0.41666667 -0.08333333 0.25000000 0.25000000
## 10 1 0.16666667 0.16666667 0.16666667 -0.16666667
## sbi_submi_ips sbi_agency_ips sbi_commun_ips
## 1 -0.25000000 0.0000000 -0.3333333
## 2 -0.25000000 0.3333333 0.0000000
## 3 -0.16666667 0.3333333 0.3333333
## 4 -0.25000000 0.6666667 0.3333333
## 5 0.25000000 -0.3333333 0.0000000
## 6 -0.25000000 0.3333333 0.0000000
## 7 -0.16666667 0.3333333 0.3333333
## 8 -0.08333333 0.3333333 0.0000000
## 9 -0.41666667 0.6666667 -0.3333333
## 10 -0.16666667 0.3333333 0.3333333
# Read in the person-level data
<- read.csv(file = "AMIBshare_persons_2019_0501.csv", head = TRUE, sep = ",")
amib_persons
# View the first 10 rows of the persons data
head(amib_persons, 10)
## id cohort phase2 sex yearinschool nach_iap ffail wofo_w wofo_m wofo_wm
## 1 101 1 0 2 1 2.0 2.40 3.666667 3.625000 3.648810
## 2 102 1 0 2 1 5.0 3.60 4.166667 2.625000 3.505952
## 3 103 1 0 2 3 3.8 2.80 4.333333 3.125000 3.815476
## 4 104 1 0 2 2 3.6 3.75 5.000000 3.428571 4.326531
## 5 105 1 0 2 1 4.2 2.80 4.833333 3.375000 4.208333
## 6 106 1 0 2 2 3.8 5.00 4.333333 3.875000 4.136905
## 7 107 1 0 1 4 5.0 2.40 4.500000 3.250000 3.964286
## 8 108 1 0 2 1 3.4 3.80 4.333333 3.125000 3.815476
## 9 109 1 0 1 2 4.0 4.40 4.333333 2.500000 3.547619
## 10 110 1 0 2 1 3.4 2.00 4.500000 3.250000 3.964286
## wofo_wmtot socdes tpfs_aut tpfs_hub pni_cse pni_exp pni_ssse pni_hds
## 1 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.5714286
## 2 3.285714 0.4615385 4.142857 1.000000 0.7500000 1.6 3.000000 0.8571429
## 3 3.642857 0.2307692 3.428571 1.000000 2.0833333 3.2 2.166667 3.2857143
## 4 4.153846 0.3076923 4.142857 1.142857 0.2500000 0.6 0.500000 1.6666667
## 5 4.000000 0.4615385 3.428571 1.142857 3.8333333 2.2 3.000000 2.8571429
## 6 4.071429 0.6153846 3.833333 1.857143 0.5000000 1.4 1.500000 3.1428571
## 7 3.785714 0.3846154 4.142857 1.285714 1.8181818 4.2 2.333333 1.7142857
## 8 3.642857 0.3076923 2.857143 2.285714 4.0833333 2.8 3.833333 3.2857143
## 9 3.285714 0.0000000 3.285714 1.857143 3.0000000 2.0 3.166667 3.1428571
## 10 3.785714 0.7692308 2.571429 1.000000 2.4166667 3.2 3.166667 2.2857143
## pni_grnf pni_dev pni_enrg pni_total agg_hos agg_ang erq_reap erq_supp
## 1 1.1428571 0.7142857 0.8750000 1.7894737 1.625 1.285714 5.500000 5.75
## 2 4.8571429 0.0000000 1.1250000 1.5789474 1.250 1.000000 5.000000 2.00
## 3 2.4285714 1.1428571 2.5000000 2.3333333 2.625 2.000000 6.333333 1.25
## 4 0.7142857 0.6666667 0.1666667 0.6538462 1.500 1.000000 3.500000 3.00
## 5 3.5714286 2.0000000 2.3750000 2.8596491 2.375 1.571429 4.666667 2.25
## 6 2.4285714 0.5714286 1.3750000 1.4912281 2.625 1.000000 5.000000 1.00
## 7 3.5714286 1.4285714 2.8750000 2.5357143 2.250 3.000000 5.833333 2.25
## 8 4.8571429 3.7142857 4.5000000 3.9649123 4.000 3.857143 6.000000 4.00
## 9 4.5714286 3.7142857 3.1250000 3.3333333 3.750 3.142857 6.000000 4.50
## 10 4.1428571 2.5714286 2.0000000 2.8245614 3.375 2.142857 6.666667 2.00
## ecr_avo ecr_anx bfi_e bfi_a bfi_c bfi_n bfi_o iipsc_pa iipsc_bc iipsc_de
## 1 4.833333 2.166667 3.5 1.5 4.0 2.0 4.0 1 1 11
## 2 1.333333 1.833333 5.0 4.5 3.5 2.0 2.5 0 0 0
## 3 1.333333 2.666667 4.0 4.5 3.5 2.5 5.0 5 0 1
## 4 1.833333 2.400000 3.0 4.5 4.5 2.5 3.0 4 1 7
## 5 2.166667 4.166667 3.5 3.5 3.0 3.5 4.5 2 1 5
## 6 1.000000 2.500000 3.0 3.5 5.0 1.5 3.0 NA 3 0
## 7 3.666667 3.800000 5.0 4.0 5.0 1.5 4.0 1 0 1
## 8 3.833333 6.833333 3.5 3.0 5.0 4.5 3.0 9 14 9
## 9 2.166667 5.166667 3.5 3.0 3.0 4.0 3.0 8 8 3
## 10 3.666667 5.666667 3.0 3.5 3.5 3.5 5.0 0 2 4
## iipsc_fg iipsc_hi iipsc_jk iipsc_lm iipsc_no stif_fix stif_inc stif_diff
## 1 1 2 2 4 1 2.000000 5.000000 3.0000000
## 2 0 2 1 0 0 1.666667 4.666667 3.0000000
## 3 3 4 3 1 4 2.000000 5.333333 3.3333333
## 4 4 6 6 3 NA 3.333333 3.333333 0.0000000
## 5 5 9 7 6 7 3.333333 3.333333 0.0000000
## 6 0 2 0 6 6 5.333333 1.333333 -4.0000000
## 7 0 3 4 5 7 3.666667 2.666667 -1.0000000
## 8 9 10 12 11 12 5.333333 2.000000 -3.3333333
## 9 7 11 9 8 11 3.000000 5.000000 2.0000000
## 10 3 5 5 8 6 3.666667 3.333333 -0.3333333
## vdi_exp vdi_sub vdi_lov tsca_shame tsca_guilt csiv_pa csiv_bc csiv_de
## 1 21 20 31 1.7500 3.9375 1.125 0.000 0.750
## 2 30 14 54 1.4375 4.0000 3.125 2.500 1.125
## 3 22 17 42 2.1250 3.1875 2.375 0.750 0.250
## 4 18 NA 37 3.0000 4.1875 1.500 0.875 1.375
## 5 41 25 43 3.2500 3.9375 2.000 1.375 1.000
## 6 35 16 41 3.6250 4.0625 2.625 1.000 0.000
## 7 38 16 47 1.9375 3.8125 2.500 1.750 0.625
## 8 45 38 36 3.7500 3.5625 3.875 3.375 3.000
## 9 41 40 46 3.6250 3.7500 2.750 2.000 1.875
## 10 40 31 50 3.1875 4.7500 2.500 0.500 0.500
## csiv_fg csiv_hi csiv_jk csiv_lm csiv_no csiv_mean pni_grandi pni_vulner
## 1 0.250 0.000 1.625 1.125000 1.375000 0.781250 2.0920635 1.7693452
## 2 1.500 2.125 3.500 3.750000 4.000000 2.703125 3.1523810 0.6830357
## 3 1.125 0.625 0.625 2.250000 2.250000 1.281250 2.5984127 2.2529762
## 4 1.500 0.875 1.750 2.000000 2.285714 1.520089 0.6047619 0.6875000
## 5 2.125 2.625 3.000 2.875000 3.000000 2.250000 2.9238095 2.7663690
## 6 1.375 1.250 2.250 3.375000 3.000000 1.859375 1.7761905 1.3973214
## 7 1.625 2.250 3.250 3.250000 3.500000 2.343750 3.3682540 1.9590097
## 8 2.875 3.250 3.875 4.000000 3.625000 3.484375 3.8301587 3.8958333
## 9 2.250 2.625 3.250 3.142857 2.875000 2.595982 3.2460317 3.2455357
## 10 1.250 1.125 3.000 3.375000 3.625000 1.984375 3.5031746 2.3184524
# Merge daily and person-level data
<- merge(amib_persons, amib_interaction, by = "id")
amib
# View the first 10 rows of the merged data
head(amib, 10)
## id cohort phase2 sex yearinschool nach_iap ffail wofo_w wofo_m wofo_wm
## 1 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 2 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 3 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 4 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 5 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 6 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 7 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 8 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 9 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## 10 101 1 0 2 1 2 2.4 3.666667 3.625 3.64881
## wofo_wmtot socdes tpfs_aut tpfs_hub pni_cse pni_exp pni_ssse pni_hds
## 1 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 2 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 3 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 4 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 5 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 6 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 7 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 8 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 9 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## 10 3.642857 0.3846154 3.428571 2.142857 0.9166667 3.8 1.333333 4.571429
## pni_grnf pni_dev pni_enrg pni_total agg_hos agg_ang erq_reap erq_supp
## 1 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 2 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 3 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 4 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 5 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 6 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 7 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 8 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 9 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## 10 1.142857 0.7142857 0.875 1.789474 1.625 1.285714 5.5 5.75
## ecr_avo ecr_anx bfi_e bfi_a bfi_c bfi_n bfi_o iipsc_pa iipsc_bc iipsc_de
## 1 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 2 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 3 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 4 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 5 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 6 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 7 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 8 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 9 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## 10 4.833333 2.166667 3.5 1.5 4 2 4 1 1 11
## iipsc_fg iipsc_hi iipsc_jk iipsc_lm iipsc_no stif_fix stif_inc stif_diff
## 1 1 2 2 4 1 2 5 3
## 2 1 2 2 4 1 2 5 3
## 3 1 2 2 4 1 2 5 3
## 4 1 2 2 4 1 2 5 3
## 5 1 2 2 4 1 2 5 3
## 6 1 2 2 4 1 2 5 3
## 7 1 2 2 4 1 2 5 3
## 8 1 2 2 4 1 2 5 3
## 9 1 2 2 4 1 2 5 3
## 10 1 2 2 4 1 2 5 3
## vdi_exp vdi_sub vdi_lov tsca_shame tsca_guilt csiv_pa csiv_bc csiv_de
## 1 21 20 31 1.75 3.9375 1.125 0 0.75
## 2 21 20 31 1.75 3.9375 1.125 0 0.75
## 3 21 20 31 1.75 3.9375 1.125 0 0.75
## 4 21 20 31 1.75 3.9375 1.125 0 0.75
## 5 21 20 31 1.75 3.9375 1.125 0 0.75
## 6 21 20 31 1.75 3.9375 1.125 0 0.75
## 7 21 20 31 1.75 3.9375 1.125 0 0.75
## 8 21 20 31 1.75 3.9375 1.125 0 0.75
## 9 21 20 31 1.75 3.9375 1.125 0 0.75
## 10 21 20 31 1.75 3.9375 1.125 0 0.75
## csiv_fg csiv_hi csiv_jk csiv_lm csiv_no csiv_mean pni_grandi pni_vulner day
## 1 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 2 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 3 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 4 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 5 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 6 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 7 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 8 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 1
## 9 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 2
## 10 0.25 0 1.625 1.125 1.375 0.78125 2.092063 1.769345 2
## interaction timea timeb dur choice1 choice2 location partner_gender
## 1 1 700 900 60 6 3 2 0
## 2 2 1230 1330 60 2 6 3 1
## 3 3 1245 1330 10 2 6 3 1
## 4 4 1330 1417 90 1 7 5 1
## 5 5 1420 1500 15 3 5 1 1
## 6 6 1445 1600 45 2 6 2 1
## 7 7 1920 1945 30 2 6 5 1
## 8 8 2030 2145 45 2 6 1 1
## 9 9 30 200 60 4 4 2 0
## 10 10 0 300 120 2 6 2 1
## partner_status first mtone length level igaff igdom agval agarous stress
## 1 NA 0 0 3 2 7 6 3 3 1
## 2 4 0 0 2 2 8 6 8 6 1
## 3 4 0 1 2 2 8 6 8 6 1
## 4 4 0 0 6 4 9 8 8 7 1
## 5 9 0 0 96 4 4 5 6 5 1
## 6 4 0 0 6 3 8 7 8 7 1
## 7 4 0 NA 6 4 8 7 8 7 1
## 8 4 0 NA 6 4 8 7 8 7 1
## 9 5 0 1 2 2 7 6 9 5 0
## 10 4 0 1 6 4 8 7 8 6 0
## health sbi_extra sbi_agree sbi_domin sbi_quarl sbi_submi sbi_agency
## 1 3 1 0.3333333 0.0000000 0.6666667 0.0000000 0
## 2 3 0 0.3333333 0.3333333 0.3333333 0.0000000 1
## 3 3 0 0.3333333 0.3333333 0.0000000 0.0000000 1
## 4 3 0 0.3333333 0.6666667 0.0000000 0.0000000 2
## 5 3 0 0.0000000 0.0000000 0.0000000 0.3333333 -1
## 6 3 0 0.3333333 0.3333333 0.3333333 0.0000000 1
## 7 3 0 0.3333333 0.3333333 0.0000000 0.0000000 1
## 8 3 0 0.0000000 0.3333333 0.0000000 0.0000000 1
## 9 2 0 0.3333333 0.6666667 0.6666667 0.0000000 2
## 10 2 0 0.3333333 0.3333333 0.0000000 0.0000000 1
## sbi_commun sbi_total sbi_agree_ips sbi_domin_ips sbi_quarl_ips
## 1 -1 0.25000000 0.08333333 -0.25000000 0.41666667
## 2 0 0.25000000 0.08333333 0.08333333 0.08333333
## 3 1 0.16666667 0.16666667 0.16666667 -0.16666667
## 4 1 0.25000000 0.08333333 0.41666667 -0.25000000
## 5 0 0.08333333 -0.08333333 -0.08333333 -0.08333333
## 6 0 0.25000000 0.08333333 0.08333333 0.08333333
## 7 1 0.16666667 0.16666667 0.16666667 -0.16666667
## 8 0 0.08333333 -0.08333333 0.25000000 -0.08333333
## 9 -1 0.41666667 -0.08333333 0.25000000 0.25000000
## 10 1 0.16666667 0.16666667 0.16666667 -0.16666667
## sbi_submi_ips sbi_agency_ips sbi_commun_ips
## 1 -0.25000000 0.0000000 -0.3333333
## 2 -0.25000000 0.3333333 0.0000000
## 3 -0.16666667 0.3333333 0.3333333
## 4 -0.25000000 0.6666667 0.3333333
## 5 0.25000000 -0.3333333 0.0000000
## 6 -0.25000000 0.3333333 0.0000000
## 7 -0.16666667 0.3333333 0.3333333
## 8 -0.08333333 0.3333333 0.0000000
## 9 -0.41666667 0.6666667 -0.3333333
## 10 -0.16666667 0.3333333 0.3333333
# Subset the data to select the variables we need
<- amib[ , c("id", "day", "interaction", "partner_status",
amib "igaff", "igdom", "sbi_commun", "bfi_e")]
# View the first 10 rows of the subset data
head(amib, 10)
## 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
## 7 101 1 7 4 8 7 1 3.5
## 8 101 1 8 4 8 7 0 3.5
## 9 101 2 9 5 7 6 -1 3.5
## 10 101 2 10 4 8 7 1 3.5
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
)
After merging, we have a data set with 7,568 rows and 8 columns of data, with person-level (i.e., time invariant) information attached to all measurement occasions.
Load the R packages we need.
Packages in R are a collection of functions (and their documentation/explanations) that enable us to conduct particular tasks, such as plotting or fitting a statistical model.
# install.packages("devtools") # Install package if you have never used it before
require(devtools) # For version control
# install.packages("dplyr") # Install package if you have never used it before
library(dplyr) # For data manipulation
# install.packages("fastDummies") # Install package if you have never used it before
library(fastDummies) # For creating dummy codes
# install.packages("ggplot2") # Install package if you have never used it before
library(ggplot2) # For plotting
# install.packages("nlme") # Install package if you have never used it before
library(nlme) # For multilevel modeling analysis
# install.packages("psych") # Install package if you have never used it before
library(psych) # For descriptive statistics
# install.packages("reshape2") # Install package if you have never used it before
library(reshape2) # For data manipulation
Create a variable within each partner type that counts the number of interactions with that partner type.
<- # Select data set
amib %>%
amib # Select grouping variable, in this case,
# focal person (id) and partner type within focal person (partner_status)
group_by(id, partner_status) %>%
# Save the data as a data.frame
as.data.frame()
# View the first 10 rows of the data
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
Descriptives, Data Preparation, and Plotting.
Descriptives.
Before beginning our analyses, it is useful to get a feel for the data we are working with. So, we start by describing the number of social interactions for each participant and the number of social interactions per day for each participant.
Number of social interactions per participant.
<- # Select data set
int_count %>%
amib # Select grouping variable, in this case, focal person (id)
group_by(id) %>%
# Create new variable ("num_interactions") that
# counts the number of social interactions per focal person
summarise(num_interactions = length(interaction)) %>%
# Save the data as a data.frame
as.data.frame()
# Describe the average number of social interactions per focal person
describe(int_count$num_interactions)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 184 41.13 13.62 43 42.45 17.79 10 56 46 -0.53 -0.94 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.
<- # Select data set
int_count_day %>%
amib # Select grouping variable, in this case,
# focal person (id) and day within focal person (day)
group_by(id, day) %>%
# Create new variable ("num_interactions") that
# counts the number of social interactions per focal person
summarise(num_interactions = length(interaction)) %>%
# Save the data as a data.frame
as.data.frame()
## `summarise()` has grouped output by 'id'. You can override using the `.groups`
## argument.
# View the first 10 rows of the count data
head(int_count_day)
## id day num_interactions
## 1 101 1 8
## 2 101 2 8
## 3 101 3 8
## 4 101 4 8
## 5 101 5 8
## 6 101 6 8
# Describe the average number of social interactions per focal person within a day
describe(int_count_day$num_interactions)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 1255 6.03 2.12 7 6.28 1.48 1 8 7 -0.63 -0.9 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 interaction 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. Above the histograms for the two partner-related variables,
you will see a warning about rows being removed. In this case, it is due
to missing values in the data set, but it is always a good idea to
examine your data to identify reasons for warning messages.
# Describe focal person reports of communion
describe(amib$sbi_commun)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 7568 0.87 1.06 1 0.9 1.48 -3 3 6 -0.23 0.1 0.01
# Plot distribution of focal person communion
ggplot(# Select data set, value on x-axis
data = amib, aes(x = sbi_commun)) +
# Select width of histogram bars
geom_histogram(binwidth = 0.5) +
# Label for x-axis
xlab("Focal Person Communion") +
# Plot aesthetics
theme_classic()
# Describe partner reports of communion
describe(amib$igaff)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 7554 7.06 1.76 7 7.31 1.48 1 9 8 -1.16 1.11 0.02
ggplot(# Select data set, value on x-axis
data = amib, aes(x = igaff)) +
# Select width of histogram bars
geom_histogram(binwidth = 0.5) +
# Label for x-axis
xlab("Partner Communion") +
# Plot aesthetics
theme_classic()
## Warning: Removed 14 rows containing non-finite values (stat_bin).
# Describe focal person extraversion
describe(amib$bfi_e)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 7568 3.41 0.97 3.5 3.43 0.74 1 5 4 -0.24 -0.52 0.01
ggplot(# Select data set, value on x-axis
data = amib, aes(x = bfi_e)) +
# Select width of histogram bars
geom_histogram(binwidth = 0.25) +
# Label for x-axis
xlab("Focal Person Extraversion") +
# Plot aesthetics
theme_classic()
# Describe partner dominance
describe(amib$igdom)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 7553 6.74 1.67 7 6.9 1.48 1 9 8 -0.83 0.44 0.02
ggplot(# Select data set, value on x-axis
data = amib, aes(x = igdom)) +
# Select width of histogram bars
geom_histogram(binwidth = 0.5) +
# Label for x-axis
xlab("Partner Dominance") +
# Plot aesthetics
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 8 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 ...
We need to change “partner_status” to a factor variable to recognize that the numerical values in this column denote types of relationships. This will make sure R treats partner_status as a categorical variable.
$partner_status <- as.factor(amib$partner_status) amib
We also create dummy codes for the “partner_status” variable, which we will use in the three-level OWM model.
<- dummy_cols(amib, select_columns = c("partner_status")) amib
For the sake of this tutorial, remove rows in which information about the partner is missing.
<- amib[complete.cases(amib[ , "partner_status"]),] amib
Then, we have to re-do the interaction count (int_count
)
variable to re-count the interactions now that we removed the missing
data.
<- # Select data set
amib %>%
amib # Select grouping variable, in this case,
# focal person (id)
group_by(id) %>%
# Create new variable ("interaction") that
# counts each row 1 by 1, starting from 1
mutate(interaction = 1:length(interaction)) %>%
# Save the data as a data.frame
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[rep(seq_len(nrow(amib)), # Repeat the length of each row
amib # in the amib data set
each=2), ] # Repeat each row twice
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
# Identify even and odd rows in the data set
<- seq(2, nrow(amib), 2)
even_indexes <- seq(1, nrow(amib) - 1, 2)
odd_indexes
# Focal person dummy code
$focalcode <- 0
amib"focalcode"] <- 1
amib[odd_indexes,
# Partner dummy code
$partcode <- 1
amib"partcode"] <- 0
amib[odd_indexes,
# View the first 10 rows of the data
head(amib, 10)
## 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
## 4 101 1 4 9 4 5 0 3.5
## 4.1 101 1 4 9 4 5 0 3.5
## 5 101 1 5 4 8 7 0 3.5
## 5.1 101 1 5 4 8 7 0 3.5
## partner_status_1 partner_status_2 partner_status_3 partner_status_4
## 1 0 0 0 1
## 1.1 0 0 0 1
## 2 0 0 0 1
## 2.1 0 0 0 1
## 3 0 0 0 1
## 3.1 0 0 0 1
## 4 0 0 0 0
## 4.1 0 0 0 0
## 5 0 0 0 1
## 5.1 0 0 0 1
## partner_status_5 partner_status_6 partner_status_7 partner_status_8
## 1 0 0 0 0
## 1.1 0 0 0 0
## 2 0 0 0 0
## 2.1 0 0 0 0
## 3 0 0 0 0
## 3.1 0 0 0 0
## 4 0 0 0 0
## 4.1 0 0 0 0
## 5 0 0 0 0
## 5.1 0 0 0 0
## partner_status_9 partner_status_NA focalcode partcode
## 1 0 0 1 0
## 1.1 0 0 0 1
## 2 0 0 1 0
## 2.1 0 0 0 1
## 3 0 0 1 0
## 3.1 0 0 0 1
## 4 1 0 1 0
## 4.1 1 0 0 1
## 5 0 0 1 0
## 5.1 0 0 0 1
Self and partner communion are on different scales, so we will standardize these for the sake of interpretation.
$self_comm <- scale(amib$igaff)
amib$partner_comm <- scale(amib$sbi_commun) amib
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).
$bfi_e_c <- scale(amib$bfi_e, center = TRUE, scale = FALSE) amib
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.
$communion[amib$focalcode == 1] <- amib$self_comm[amib$focalcode == 1]
amib
$communion[amib$partcode == 1] <- amib$partner_comm[amib$partcode == 1]
amib
# View the first 10 rows of the data
head(amib, 10)
## 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
## 4 101 1 4 9 4 5 0 3.5
## 4.1 101 1 4 9 4 5 0 3.5
## 5 101 1 5 4 8 7 0 3.5
## 5.1 101 1 5 4 8 7 0 3.5
## partner_status_1 partner_status_2 partner_status_3 partner_status_4
## 1 0 0 0 1
## 1.1 0 0 0 1
## 2 0 0 0 1
## 2.1 0 0 0 1
## 3 0 0 0 1
## 3.1 0 0 0 1
## 4 0 0 0 0
## 4.1 0 0 0 0
## 5 0 0 0 1
## 5.1 0 0 0 1
## partner_status_5 partner_status_6 partner_status_7 partner_status_8
## 1 0 0 0 0
## 1.1 0 0 0 0
## 2 0 0 0 0
## 2.1 0 0 0 0
## 3 0 0 0 0
## 3.1 0 0 0 0
## 4 0 0 0 0
## 4.1 0 0 0 0
## 5 0 0 0 0
## 5.1 0 0 0 0
## partner_status_9 partner_status_NA focalcode partcode self_comm
## 1 0 0 1 0 0.5143292
## 1.1 0 0 0 1 0.5143292
## 2 0 0 1 0 0.5143292
## 2.1 0 0 0 1 0.5143292
## 3 0 0 1 0 1.0914917
## 3.1 0 0 0 1 1.0914917
## 4 1 0 1 0 -1.7943208
## 4.1 1 0 0 1 -1.7943208
## 5 0 0 1 0 0.5143292
## 5.1 0 0 0 1 0.5143292
## partner_comm bfi_e_c communion
## 1 -0.8317975 0.08693182 0.5143292
## 1.1 -0.8317975 0.08693182 -0.8317975
## 2 0.1119341 0.08693182 0.5143292
## 2.1 0.1119341 0.08693182 0.1119341
## 3 0.1119341 0.08693182 1.0914917
## 3.1 0.1119341 0.08693182 0.1119341
## 4 -0.8317975 0.08693182 -1.7943208
## 4.1 -0.8317975 0.08693182 -0.8317975
## 5 -0.8317975 0.08693182 0.5143292
## 5.1 -0.8317975 0.08693182 -0.8317975
The data are now ready for modeling!
Plotting.
Before modeling, it can be helpful to plot the data to understand between- and within-individual differences.
For a subset of participants, plot focal persons’ and partners’ reports of communion over time across partner types.
ggplot() +
geom_rect(# Create rectangles that indicate the type of
# interaction partner
# Select a subset of focal persons
data = amib[which(amib$id < 111), ],
# Set width of rectangles
aes(xmin = interaction - .5, xmax = interaction + .5,
# Set height of rectangles
ymin = -5, ymax = 5,
# Set color of rectangles to indicate
# interaction partner type
fill = as.factor(partner_status))) +
# Create line that plots partners' ratings of communion
geom_line(# Select a subset of focal persons
data = amib[which(amib$id < 111), ],
# Set time variable on x-axis (interaction),
# Set partners' communion (partner_comm) on y-axis
# Set size of line
aes(x = interaction, y = partner_comm), size = 1) +
# Create line that plots focal persons' ratings of communion
geom_line(# Select a subset of focal persons
data = amib[which(amib$id < 111), ],
# Set time variable on x-axis (interaction),
# Set focal persons' communion (self_comm) on y-axis
# Set size of line
aes(x = interaction, y = self_comm), color = "white", size = 1) +
# Label for x-axis
xlab("Interaction Number") +
# Label for y-axis
ylab("Partner Reports of Communion =
Black\nFocal Person Reports of Communion = White") +
# Create a plot for each focal person
facet_wrap( ~ id) +
# Set title for legend of rectangle color (interaction partners)
scale_fill_discrete(name = "Partner Type") +
# Additional plot aesthetics
theme_classic() +
theme(axis.text.y=element_blank())
In this plot, we can see differences in the number of interactions these 9 participants had, how self and partner reports of communion were changing from interaction to interaction (both within and across individuals), and differences in who these participants were interacting with (through the background color).
Two-level OWM model.
We’ll first 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_{di} = \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.
<- # Select data set
two_level %>%
amib # Select grouping variable, in this case,
# focal person (id) and interaction partner (partner_status)
group_by(id, partner_status) %>%
# Keep first and second row within each group
filter(row_number() == 1 | row_number() == 2) %>%
# Reset grouping variable to focal person (id) only
group_by(id) %>%
# Create new variable (measurement) that
# counts each interaction 1 by 1, starting from 1
# but since there are two measurements per interaction,
# each value needs to be repeated for two rows
mutate(measurement = rep(1:(n()/2), each = 2)) %>%
# Save the data as a data.frame
as.data.frame()
# View the first 10 rows of the data
head(two_level, 10)
## 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
## 7 103 3 1 9 6 7 2 4.0
## 8 103 3 1 9 6 7 2 4.0
## 9 103 4 3 7 7 9 3 4.0
## 10 103 4 3 7 7 9 3 4.0
## partner_status_1 partner_status_2 partner_status_3 partner_status_4
## 1 0 0 0 1
## 2 0 0 0 1
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## 7 0 0 0 0
## 8 0 0 0 0
## 9 0 0 0 0
## 10 0 0 0 0
## partner_status_5 partner_status_6 partner_status_7 partner_status_8
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 1 0 0 0
## 6 1 0 0 0
## 7 0 0 0 0
## 8 0 0 0 0
## 9 0 0 1 0
## 10 0 0 1 0
## partner_status_9 partner_status_NA focalcode partcode self_comm
## 1 0 0 1 0 0.51432924
## 2 0 0 0 1 0.51432924
## 3 1 0 1 0 -1.79432077
## 4 1 0 0 1 -1.79432077
## 5 0 0 1 0 -0.06283326
## 6 0 0 0 1 -0.06283326
## 7 1 0 1 0 -0.63999576
## 8 1 0 0 1 -0.63999576
## 9 0 0 1 0 -0.06283326
## 10 0 0 0 1 -0.06283326
## partner_comm bfi_e_c communion measurement
## 1 -0.8317975 0.08693182 0.51432924 1
## 2 -0.8317975 0.08693182 -0.83179748 1
## 3 -0.8317975 0.08693182 -1.79432077 2
## 4 -0.8317975 0.08693182 -0.83179748 2
## 5 -1.7755290 0.08693182 -0.06283326 3
## 6 -1.7755290 0.08693182 -1.77552903 3
## 7 1.0556656 0.58693182 -0.63999576 1
## 8 1.0556656 0.58693182 1.05566562 1
## 9 1.9993972 0.58693182 -0.06283326 2
## 10 1.9993972 0.58693182 1.99939717 2
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.
# Set optimizer to be used in model
<- lmeControl(opt='optim')
ctrl
<- lme(# The outcome variable (communion) is regressed onto
model_2level # no intercept (-1) since we separately estimate intercepts
# for the dyad members with dummy coded variables, specifically
# focalcode and partcode, and
# extraversion's impact on the focal person and partner
# using interaction terms
fixed = communion ~
-1 +
+
focalcode +
partcode :bfi_e_c +
focalcode:bfi_e_c,
partcode# Allow for random intercepts for focal persons and partners
# within each focal person (id)
# The -1 makes sure no intercept is estimated
random = ~ -1 + focalcode + partcode | id,
# Set the weights of the variances,
# allowing for differences between
# focal persons and partners
weights = varIdent(form = ~1 | focalcode),
# Set correlation structure, in this case,
# compound symmetry within each dyad member (focal person/partner)
# within each focal person
corr = corCompSymm(form = ~as.numeric(focalcode) | id/focalcode),
# Set optimizer
control = ctrl,
# Select data set
data = two_level,
# Exclude rows with missing data
na.action = na.exclude)
# Examine the model summary
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: ~as.numeric(focalcode) | 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 differences (1) between dyads within focal persons and (2) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partners 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 kurtosis
## X1 1 14080 0 0.97 0.09 0.02 0.74 -2.41 1.59 4 -0.23 -0.54
## se
## X1 0.01
# Points at which to estimate communion
<- c(-0.97, 0, 0.97)
extraversion
# Calculate communion for each focal person and partner +/- 1SD extraversion
<- -0.12 + -0.01*extraversion
fp_est
<- 0.02 + -0.01*extraversion
p_est
# Combine all of these into one vector
<- c(fp_est, p_est) fit_estimates
Build a data set that contains the predicted values.
# Focal person / partner label
<- rep(c("Focal Person", "Partner"), each = 3)
focal_partner
# Extraversion levels
<- rep(c(-0.97, 0, 0.97), 2)
extraversion_repeat
<- data.frame(focal_partner = focal_partner, extraversion = extraversion_repeat, fit_estimates) plot_data
Plot.
ggplot(# Select data set
plot_data, # Select value on x-axis (extraversion) and
# value on y-axis (predicted values)
# Set color of line depending on dyad member
aes(x = extraversion, y = fit_estimates,
color = focal_partner, group = focal_partner)) +
# Set size of line
geom_line(size = 1) +
# Label axes and legend
labs(title = "Extraversion-Communion Association",
x = "Extraversion", y = "Communion",
color = "Person", fill = "Person", size = 12) +
# Set limits of y-axis
ylim(-2, 2) +
# Plot aesthetics
theme_classic() +
theme(text=element_text(size=12)) +
theme(plot.title = element_text(hjust = 0.5))
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. We also recast
partner_status
as a set of 8 dummy variables
(partner_status_2
through partner_status_9
).
The partner_status
equal to 1 was used as the reference
category, and the model parameters associated with the 8 dummy variables
represent deviations for each partner type from the
partner_status
equal to 1 type.
Level 1 of the multilevel model is as follows:
\[Communion_{tdi} = \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_{00Fi} + \gamma_{01Fi}Partner2_{di} + ... + \gamma_{08Fi}Partner9_{di} + u_{0Fdi} \\ \beta_{0Pdi} = \gamma_{00Pi} + \gamma_{01Pi}Partner2_{di} + ... + \gamma_{08Pi}Partner9_{di} + u_{0Pdi} \\ \beta_{1Fdi} = \gamma_{10Fi} + \gamma_{11Fi}Partner2_{di} + ... + \gamma_{18Fi}Partner9_{di} + u_{1Fdi} \\ \beta_{1Pdi} = \gamma_{10Pi} + \gamma_{11Pi}Partner2_{di} + ... + \gamma_{18Pi}Partner9_{di} + u_{1Pdi}\]
Finally, Level 3 of the multilevel model:
\[\gamma_{00Fi} = \pi_{000F} + \pi_{001F}FocalExtraversion_{i} + v_{00Fi} \\ \gamma_{01Fi} = \pi_{010F} + \pi_{011F}FocalExtraversion_{i} \\ ... \\ \gamma_{08Fi} = \pi_{080F} + \pi_{081F}FocalExtraversion_{i} \\ \gamma_{00Pi} = \pi_{000P} + \pi_{001P}FocalExtraversion_{i} + v_{00Pi} \\ \gamma_{01Pi} = \pi_{010P} + \pi_{011P}FocalExtraversion_{i} \\ ... \\ \gamma_{10Fi} = \pi_{100F} + \pi_{101F}FocalExtraversion_{i} + v_{10Fi} \\ \gamma_{11Fi} = \pi_{110F} + \pi_{111F}FocalExtraversion_{i} \\ ... \\ \gamma_{18Fi} = \pi_{180F} + \pi_{181F}FocalExtraversion_{i} \\ \gamma_{10Pi} = \pi_{100P} + \pi_{101P}FocalExtraversion_{i} + v_{10Pi} \\ \gamma_{11Pi} = \pi_{110P} + \pi_{111P}FocalExtraversion_{i} \\ ... \\ \gamma_{18Pi} = \pi_{180P} + \pi_{181P}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 4 x 4 matrix that contains the variances and covariances of the random effects at the third level.
The following model examines 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.
# Set optimizer to be used in model
<- lmeControl(opt='optim')
ctrl
<- lme(# The outcome variable (communion) is regressed onto
model_3level # no intercept (-1) since we separately estimate intercepts
# for the dyad members with dummy coded variables, specifically
# focalcode and partcode, and
# the impact of partners' dominance on communion
# using interaction terms, and
# extraversion's impact on the focal person and partner
# using interaction terms, and
# three-way interactions between dominance and extraversion
# on communion
fixed = communion ~
-1 +
+ partcode +
focalcode :igdom + partcode:igdom +
focalcode:bfi_e_c + partcode:bfi_e_c +
focalcode:igdom:bfi_e_c + partcode:igdom:bfi_e_c +
focalcode
# Estimating communion intercepts for each partner type from
# both the focal person and partner perspective
:partner_status_2 + partcode:partner_status_2 +
focalcode:partner_status_3 + partcode:partner_status_3 +
focalcode:partner_status_4 + partcode:partner_status_4 +
focalcode:partner_status_5 + partcode:partner_status_5 +
focalcode:partner_status_6 + partcode:partner_status_6 +
focalcode:partner_status_7 + partcode:partner_status_7 +
focalcode:partner_status_8 + partcode:partner_status_8 +
focalcode:partner_status_9 + partcode:partner_status_9 +
focalcode
# Estimating impact of partner's dominance on communion for each partner type from
# both the focal person and partner perspective
:partner_status_2:igdom + partcode:partner_status_2:igdom +
focalcode:partner_status_3:igdom + partcode:partner_status_3:igdom +
focalcode:partner_status_4:igdom + partcode:partner_status_4:igdom +
focalcode:partner_status_5:igdom + partcode:partner_status_5:igdom +
focalcode:partner_status_6:igdom + partcode:partner_status_6:igdom +
focalcode:partner_status_7:igdom + partcode:partner_status_7:igdom +
focalcode:partner_status_8:igdom + partcode:partner_status_8:igdom +
focalcode:partner_status_9:igdom + partcode:partner_status_9:igdom +
focalcode
# Estimating impact of focal person's extraversion on communion for each
# partner type from both the focal person and partner perspective
:partner_status_2:bfi_e_c + partcode:partner_status_2:bfi_e_c +
focalcode:partner_status_3:bfi_e_c + partcode:partner_status_3:bfi_e_c +
focalcode:partner_status_4:bfi_e_c + partcode:partner_status_4:bfi_e_c +
focalcode:partner_status_5:bfi_e_c + partcode:partner_status_5:bfi_e_c +
focalcode:partner_status_6:bfi_e_c + partcode:partner_status_6:bfi_e_c +
focalcode:partner_status_7:bfi_e_c + partcode:partner_status_7:bfi_e_c +
focalcode:partner_status_8:bfi_e_c + partcode:partner_status_8:bfi_e_c +
focalcode:partner_status_9:bfi_e_c + partcode:partner_status_9:bfi_e_c +
focalcode
# Estimating impact of interaction between dominance and extraversion
# on communion for each partner type
# from both the focal person and partner perspective
:partner_status_2:igdom:bfi_e_c +
focalcode:partner_status_2:igdom:bfi_e_c +
partcode:partner_status_3:igdom:bfi_e_c +
focalcode:partner_status_3:igdom:bfi_e_c +
partcode:partner_status_4:igdom:bfi_e_c +
focalcode:partner_status_4:igdom:bfi_e_c +
partcode:partner_status_5:igdom:bfi_e_c +
focalcode:partner_status_5:igdom:bfi_e_c +
partcode:partner_status_6:igdom:bfi_e_c +
focalcode:partner_status_6:igdom:bfi_e_c +
partcode:partner_status_7:igdom:bfi_e_c +
focalcode:partner_status_7:igdom:bfi_e_c +
partcode:partner_status_8:igdom:bfi_e_c +
focalcode:partner_status_8:igdom:bfi_e_c +
partcode:partner_status_9:igdom:bfi_e_c +
focalcode:partner_status_9:igdom:bfi_e_c,
partcode
# Allow for random intercepts and slopes for focal persons and partners
# within each focal person (id) and partner type (partner_status)
# The -1 makes sure no intercept is estimated
random = ~ -1 + focalcode + partcode +
:igdom + partcode:igdom | id/partner_status,
focalcode
# Set the weights of the variances,
# allowing for differences between
# focal persons and partners
weights = varIdent(form = ~1 | focalcode),
# Set correlation structure, in this case,
# compound symmetry within each dyad member (focal person/partner_status)
# within each focal person
corr = corCompSymm(form = ~as.numeric(focalcode) | id/partner_status),
# Set optimizer
control = ctrl,
# Select data set
data = amib,
# Exclude rows with missing data
na.action = na.exclude)
#summary(model_3level)
# Fixed Effects
summary(model_3level)$tTable
## Value Std.Error DF
## focalcode -0.691902706 0.36655434 13193
## partcode -0.090677833 0.33252993 13193
## focalcode:igdom 0.039132308 0.05007862 13193
## partcode:igdom -0.001704396 0.04506358 13193
## focalcode:bfi_e_c 0.434478600 0.35063774 13193
## partcode:bfi_e_c 0.407009627 0.30435589 13193
## focalcode:partner_status_2 -0.185232089 0.55948875 13193
## partcode:partner_status_2 0.327897025 0.47998965 13193
## focalcode:partner_status_3 -0.081882122 1.34230334 13193
## partcode:partner_status_3 0.207397406 1.37996826 13193
## focalcode:partner_status_4 -0.208352774 0.37715546 13193
## partcode:partner_status_4 -0.123238940 0.33846935 13193
## focalcode:partner_status_5 -0.137595827 0.40379462 13193
## partcode:partner_status_5 -0.051188717 0.36273300 13193
## focalcode:partner_status_6 -0.918697490 0.43076967 13193
## partcode:partner_status_6 -0.617463921 0.37951888 13193
## focalcode:partner_status_7 -0.258796973 0.59931777 13193
## partcode:partner_status_7 -0.091425961 0.53666988 13193
## focalcode:partner_status_8 -0.430351652 0.65303658 13193
## partcode:partner_status_8 0.259815068 0.60295172 13193
## focalcode:partner_status_9 -0.685630341 0.38884960 13193
## partcode:partner_status_9 -0.287198374 0.34880846 13193
## focalcode:igdom:bfi_e_c -0.081562187 0.04760756 13193
## partcode:igdom:bfi_e_c -0.060633594 0.04104292 13193
## focalcode:igdom:partner_status_2 0.068007714 0.08022156 13193
## partcode:igdom:partner_status_2 -0.041291798 0.06865947 13193
## focalcode:igdom:partner_status_3 -0.039384803 0.17724281 13193
## partcode:igdom:partner_status_3 -0.034863443 0.17935826 13193
## focalcode:igdom:partner_status_4 0.103019015 0.05157272 13193
## partcode:igdom:partner_status_4 0.041702129 0.04588623 13193
## focalcode:igdom:partner_status_5 0.061167021 0.05594326 13193
## partcode:igdom:partner_status_5 0.014305055 0.05012603 13193
## focalcode:igdom:partner_status_6 0.215111790 0.05944744 13193
## partcode:igdom:partner_status_6 0.104706792 0.05198555 13193
## focalcode:igdom:partner_status_7 0.084184110 0.08132932 13193
## partcode:igdom:partner_status_7 0.031027434 0.07245150 13193
## focalcode:igdom:partner_status_8 0.147255276 0.09039798 13193
## partcode:igdom:partner_status_8 -0.012753986 0.08305072 13193
## focalcode:igdom:partner_status_9 0.144361935 0.05364501 13193
## partcode:igdom:partner_status_9 0.034092913 0.04779703 13193
## focalcode:bfi_e_c:partner_status_2 -0.307216764 0.55131608 13193
## partcode:bfi_e_c:partner_status_2 -0.695113226 0.46466794 13193
## focalcode:bfi_e_c:partner_status_3 2.899872529 1.42779328 13193
## partcode:bfi_e_c:partner_status_3 -0.434248184 1.41904562 13193
## focalcode:bfi_e_c:partner_status_4 -0.241279257 0.36125490 13193
## partcode:bfi_e_c:partner_status_4 -0.202908098 0.31040920 13193
## focalcode:bfi_e_c:partner_status_5 -0.043652090 0.38891877 13193
## partcode:bfi_e_c:partner_status_5 -0.151280485 0.33945328 13193
## focalcode:bfi_e_c:partner_status_6 -0.760185605 0.43029656 13193
## partcode:bfi_e_c:partner_status_6 -0.374291400 0.36338177 13193
## focalcode:bfi_e_c:partner_status_7 -0.072484741 0.65152120 13193
## partcode:bfi_e_c:partner_status_7 -0.819693749 0.59306174 13193
## focalcode:bfi_e_c:partner_status_8 -1.270841792 0.64642193 13193
## partcode:bfi_e_c:partner_status_8 -0.159320182 0.58466332 13193
## focalcode:bfi_e_c:partner_status_9 -0.224532005 0.37720032 13193
## partcode:bfi_e_c:partner_status_9 -0.216174795 0.32407625 13193
## focalcode:igdom:bfi_e_c:partner_status_2 0.080159664 0.08072751 13193
## partcode:igdom:bfi_e_c:partner_status_2 0.121141715 0.06890722 13193
## focalcode:igdom:bfi_e_c:partner_status_3 -0.411006790 0.18991244 13193
## partcode:igdom:bfi_e_c:partner_status_3 0.086616264 0.18694825 13193
## focalcode:igdom:bfi_e_c:partner_status_4 0.053326156 0.04915328 13193
## partcode:igdom:bfi_e_c:partner_status_4 0.030156415 0.04194483 13193
## focalcode:igdom:bfi_e_c:partner_status_5 0.007334003 0.05383290 13193
## partcode:igdom:bfi_e_c:partner_status_5 0.017219574 0.04700452 13193
## focalcode:igdom:bfi_e_c:partner_status_6 0.143743258 0.05948005 13193
## partcode:igdom:bfi_e_c:partner_status_6 0.067244554 0.05006303 13193
## focalcode:igdom:bfi_e_c:partner_status_7 0.052757545 0.08869164 13193
## partcode:igdom:bfi_e_c:partner_status_7 0.099018292 0.08048520 13193
## focalcode:igdom:bfi_e_c:partner_status_8 0.204378808 0.08911038 13193
## partcode:igdom:bfi_e_c:partner_status_8 0.010474603 0.08037425 13193
## focalcode:igdom:bfi_e_c:partner_status_9 0.051590016 0.05189775 13193
## partcode:igdom:bfi_e_c:partner_status_9 0.038102367 0.04434399 13193
## t-value p-value
## focalcode -1.88758564 0.0591035273
## partcode -0.27269074 0.7850952214
## focalcode:igdom 0.78141744 0.4345710367
## partcode:igdom -0.03782204 0.9698301422
## focalcode:bfi_e_c 1.23910963 0.2153269427
## partcode:bfi_e_c 1.33728192 0.1811536866
## focalcode:partner_status_2 -0.33107384 0.7405939682
## partcode:partner_status_2 0.68313353 0.4945344643
## focalcode:partner_status_3 -0.06100121 0.9513591730
## partcode:partner_status_3 0.15029143 0.8805369901
## focalcode:partner_status_4 -0.55243208 0.5806617186
## partcode:partner_status_4 -0.36410665 0.7157842069
## focalcode:partner_status_5 -0.34075696 0.7332919808
## partcode:partner_status_5 -0.14111955 0.8877776542
## focalcode:partner_status_6 -2.13268845 0.0329686997
## partcode:partner_status_6 -1.62696495 0.1037684230
## focalcode:partner_status_7 -0.43181929 0.6658798133
## partcode:partner_status_7 -0.17035791 0.8647312802
## focalcode:partner_status_8 -0.65900083 0.5099067353
## partcode:partner_status_8 0.43090526 0.6665442986
## focalcode:partner_status_9 -1.76322760 0.0778852560
## partcode:partner_status_9 -0.82336986 0.4103125801
## focalcode:igdom:bfi_e_c -1.71321905 0.0866957422
## partcode:igdom:bfi_e_c -1.47732180 0.1396132683
## focalcode:igdom:partner_status_2 0.84774855 0.3965934018
## partcode:igdom:partner_status_2 -0.60139993 0.5475839797
## focalcode:igdom:partner_status_3 -0.22220818 0.8241552640
## partcode:igdom:partner_status_3 -0.19437880 0.8458822851
## focalcode:igdom:partner_status_4 1.99754850 0.0457861288
## partcode:igdom:partner_status_4 0.90881569 0.3634640259
## focalcode:igdom:partner_status_5 1.09337605 0.2742486889
## partcode:igdom:partner_status_5 0.28538175 0.7753561647
## focalcode:igdom:partner_status_6 3.61852091 0.0002973991
## partcode:igdom:partner_status_6 2.01415177 0.0440138596
## focalcode:igdom:partner_status_7 1.03510162 0.3006404280
## partcode:igdom:partner_status_7 0.42825113 0.6684752882
## focalcode:igdom:partner_status_8 1.62896647 0.1033439920
## partcode:igdom:partner_status_8 -0.15356864 0.8779522123
## focalcode:igdom:partner_status_9 2.69105993 0.0071315155
## partcode:igdom:partner_status_9 0.71328512 0.4756819569
## focalcode:bfi_e_c:partner_status_2 -0.55724253 0.5773711915
## partcode:bfi_e_c:partner_status_2 -1.49593542 0.1346944044
## focalcode:bfi_e_c:partner_status_3 2.03101707 0.0422732721
## partcode:bfi_e_c:partner_status_3 -0.30601425 0.7595986237
## focalcode:bfi_e_c:partner_status_4 -0.66789200 0.5042142208
## partcode:bfi_e_c:partner_status_4 -0.65367940 0.5133297706
## focalcode:bfi_e_c:partner_status_5 -0.11223961 0.9106351344
## partcode:bfi_e_c:partner_status_5 -0.44565922 0.6558507376
## focalcode:bfi_e_c:partner_status_6 -1.76665506 0.0773091320
## partcode:bfi_e_c:partner_status_6 -1.03002250 0.3030183283
## focalcode:bfi_e_c:partner_status_7 -0.11125462 0.9114161354
## partcode:bfi_e_c:partner_status_7 -1.38213898 0.1669524305
## focalcode:bfi_e_c:partner_status_8 -1.96596329 0.0493237892
## partcode:bfi_e_c:partner_status_8 -0.27249902 0.7852426085
## focalcode:bfi_e_c:partner_status_9 -0.59525931 0.5516803583
## partcode:bfi_e_c:partner_status_9 -0.66704918 0.5047523834
## focalcode:igdom:bfi_e_c:partner_status_2 0.99296585 0.3207448080
## partcode:igdom:bfi_e_c:partner_status_2 1.75804099 0.0787637212
## focalcode:igdom:bfi_e_c:partner_status_3 -2.16419102 0.0304675754
## partcode:igdom:bfi_e_c:partner_status_3 0.46331679 0.6431449562
## focalcode:igdom:bfi_e_c:partner_status_4 1.08489509 0.2779879468
## partcode:igdom:bfi_e_c:partner_status_4 0.71895432 0.4721818010
## focalcode:igdom:bfi_e_c:partner_status_5 0.13623645 0.8916364377
## partcode:igdom:bfi_e_c:partner_status_5 0.36633867 0.7141182531
## focalcode:igdom:bfi_e_c:partner_status_6 2.41666347 0.0156769714
## partcode:igdom:bfi_e_c:partner_status_6 1.34319798 0.1792309809
## focalcode:igdom:bfi_e_c:partner_status_7 0.59484236 0.5519590523
## partcode:igdom:bfi_e_c:partner_status_7 1.23026711 0.2186190336
## focalcode:igdom:bfi_e_c:partner_status_8 2.29354662 0.0218322010
## partcode:igdom:bfi_e_c:partner_status_8 0.13032286 0.8963129785
## focalcode:igdom:bfi_e_c:partner_status_9 0.99407029 0.3202068807
## partcode:igdom:bfi_e_c:partner_status_9 0.85924533 0.3902207907
# Random Effects
VarCorr(model_3level)
## Variance
## id = pdLogChol(-1 + focalcode + partcode + focalcode:igdom + partcode:igdom)
## focalcode 0.942560409
## partcode 0.308426605
## focalcode:igdom 0.019083344
## partcode:igdom 0.005163955
## partner_status = pdLogChol(-1 + focalcode + partcode + focalcode:igdom + partcode:igdom)
## focalcode 1.296866716
## partcode 0.134896950
## focalcode:igdom 0.026215636
## partcode:igdom 0.001776765
## Residual 0.618586720
## StdDev Corr
## id =
## focalcode 0.97085550 foclcd partcd fclcd:
## partcode 0.55536169 0.449
## focalcode:igdom 0.13814248 -0.945 -0.539
## partcode:igdom 0.07186067 -0.589 -0.822 0.703
## partner_status =
## focalcode 1.13880056 foclcd partcd fclcd:
## partcode 0.36728320 0.792
## focalcode:igdom 0.16191243 -0.964 -0.630
## partcode:igdom 0.04215169 -0.921 -0.806 0.903
## Residual 0.78650284
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 is not significant for the reference partner type, but this association varies by partner type. For some dyads, this association is significantly different than the reference category (e.g., partner type 4), whereas for other dyads, this association is not significantly different than the reference category (e.g., partner type 3).
The association between partner communion and partner dominance during an interaction is not significant for the reference partner type, but this association varies by partner type. For some dyads, this association is significantly different than the reference category (e.g., partner type 6), whereas for other dyads, this association is not significantly different than the reference category (e.g., partner type 3).
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 is not significant for the reference partner type, but this association varies by partner type. For some dyads, this association is significantly different than the reference category (e.g., partner type 3), whereas for other dyads, this association is not significantly different than the reference category (e.g., partner type 2).
The association between partner communion and focal person extraversion is not significant for the reference partner type, and this association does not significantly differ for any partner type from the reference category.
The moderation of focal person extraversion on the association between communion and focal person dominance during an interaction is not significant for the reference partner type, but this association varies by partner type. For some focal person-partner dyads, this association is significantly different than the reference category (e.g., partner type 3), whereas for other dyads, this association is not significantly different than the reference category 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 differences (1) within dyads, (2) between dyads within focal persons, and (3) between focal persons? Stated differently, do focal persons view communion with their partners similarly and do partners 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.97 and 0.55, respectively. The standard deviation around focal person (\(\sigma_{u0Fi}\)) and partners (\(\sigma_{u0Pi}\)) reports of communion between partners within focal persons is 1.14 and 0.37, respectively.
Focal persons’ and partners’ reports of communion between focal persons are correlated 0.45, indicating that members of the same dyad often have only somewhat related reports of communion. The correlation between focal persons’ and partners’ reports of communion within a focal person is 0.79, indicating that within a focal person, focal persons in a dyad who reported higher levels of communion than average had partners who also reported higher levels of communion than average.
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.79 and the standard deviation around the partner residual (\(\sigma_{eP}\)) is 0.91 (0.786 * 1.162), indicating unique relationship effects.
Cautions and Conclusion.
While our model took into account the nesting of repeated measures within partner and within focal person, we did not consider time in our model. For example, we could’ve allowed for auto-correlated errors between time points, as there might have been carry-over from one social interaction to the next. Furthermore, we assume that there was no change in the outcome variable (i.e., communion) over the course of the study - i.e., that there were no reactivity effects to the study.
In sum, this tutorial demostrated how to run a two-level OWM model with “cross-sectional” data and extend the model to three-levels for repeated measures data. While we used data from an experience sampling study for this example, we believe this model has a wide variety of applications to various data sources, such as data collected from social media (i.e., when full network information is not available).
Additional Information
We created this tutorial with a system environment and versions of R and packages that might be different from yours. If R reports errors when you attempt to run this tutorial, running the code chunk below and comparing your output and the tutorial posted on the LHAMA website may be helpful.
session_info(pkgs = c("attached"))
## ─ Session info ───────────────────────────────────────────────────────────────
## setting value
## version R version 4.2.0 (2022-04-22)
## os macOS Big Sur/Monterey 10.16
## system x86_64, darwin17.0
## ui X11
## language (EN)
## collate en_US.UTF-8
## ctype en_US.UTF-8
## tz America/New_York
## date 2022-08-29
## pandoc 2.18 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/ (via rmarkdown)
##
## ─ Packages ───────────────────────────────────────────────────────────────────
## package * version date (UTC) lib source
## devtools * 2.4.3 2021-11-30 [1] CRAN (R 4.2.0)
## dplyr * 1.0.9 2022-04-28 [1] CRAN (R 4.2.0)
## fastDummies * 1.6.3 2020-11-29 [1] CRAN (R 4.2.0)
## ggplot2 * 3.3.6 2022-05-03 [1] CRAN (R 4.2.0)
## nlme * 3.1-157 2022-03-25 [1] CRAN (R 4.2.0)
## psych * 2.2.5 2022-05-10 [1] CRAN (R 4.2.0)
## reshape2 * 1.4.4 2020-04-09 [1] CRAN (R 4.2.0)
## usethis * 2.1.6 2022-05-25 [1] CRAN (R 4.2.0)
##
## [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library
##
## ──────────────────────────────────────────────────────────────────────────────