I. Meta-Data

In order to replicate this code file, the following files are needed in the directory data/yw/ found within the project directory: 50130_20110214.sav, 50130_2_20110214.sav, 50130_2_20110214.sav, and Survey Codes.xls. R code associated with each code chunk can be viewed and hidden by toggling on Code on the top right of each output.

knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
options(digits = 3)

libraries <- c("apaTables",    # for cor table
               "here",         # directory access
               "psych",        # for scale alphas
               "labelled",     # spss labels
               "stringr",      # working with strings
               "tidyr",        # pivot_wider
               "rio",          # import export
               "summarytools", # descriptives
               "ggplot2",      # plots
               "ggtext",       # element_markdown
               "kableExtra",   # scroll box
               "forcats",      # fct_reorder for barplot
               "sjPlot",       # plot_grid
               "dplyr",        # general wrangling
               "lmerTest")     # linear mixed models

lapply(libraries, require, character.only = TRUE)

source("00_helpers.R")
# list of loaded packages and versions
si <- devtools::session_info()[[2]]
rownames(si) <- NULL
si %>% 
  select(package, loadedversion, date, source) %>% 
  
  #red bold the called packages
  mutate(package = 
           cell_spec(package, 
                     color = ifelse(package %in% libraries, "red", "black"),
                     bold = ifelse(package %in% libraries, TRUE, FALSE))) %>% 
  knitr::kable(escape = F, caption = "All loaded packages. 
               Bolded in red are those loaded explicitly 
               with <code>library()</code>") %>% 
  kable_styling() %>% 
  scroll_box(height = "300px")
All loaded packages. Bolded in red are those loaded explicitly with library()
package loadedversion date source
apaTables 2.0.8 2021-01-04 CRAN (R 4.2.3)
backports 1.4.1 2021-12-13 CRAN (R 4.2.0)
base64enc 0.1-3 2015-07-28 CRAN (R 4.2.0)
bayestestR 0.13.1 2023-04-07 CRAN (R 4.2.3)
boot 1.3-28.1 2022-11-22 CRAN (R 4.2.3)
broom 1.0.5 2023-06-09 CRAN (R 4.2.3)
bslib 0.6.1 2023-11-28 CRAN (R 4.2.3)
cachem 1.0.8 2023-05-01 CRAN (R 4.2.3)
checkmate 2.3.1 2023-12-04 CRAN (R 4.2.3)
cli 3.6.2 2023-12-11 CRAN (R 4.2.3)
coda 0.19-4 2020-09-30 CRAN (R 4.2.3)
codetools 0.2-18 2020-11-04 CRAN (R 4.2.2)
colorspace 2.1-0 2023-01-23 CRAN (R 4.2.3)
devtools 2.4.5 2022-10-11 CRAN (R 4.2.1)
digest 0.6.33 2023-07-07 CRAN (R 4.2.3)
dplyr 1.1.4 2023-11-17 CRAN (R 4.2.3)
ellipsis 0.3.2 2021-04-29 CRAN (R 4.2.3)
emmeans 1.8.9 2023-10-17 CRAN (R 4.2.3)
estimability 1.4.1 2022-08-05 CRAN (R 4.2.1)
evaluate 0.23 2023-11-01 CRAN (R 4.2.3)
fansi 1.0.6 2023-12-08 CRAN (R 4.2.3)
fastmap 1.1.1 2023-02-24 CRAN (R 4.2.3)
forcats 1.0.0 2023-01-29 CRAN (R 4.2.3)
fs 1.6.3 2023-07-20 CRAN (R 4.2.3)
generics 0.1.3 2022-07-05 CRAN (R 4.2.3)
ggeffects 1.3.2 2023-10-17 CRAN (R 4.2.3)
ggplot2 3.4.4 2023-10-12 CRAN (R 4.2.3)
ggtext 0.1.2 2022-09-16 CRAN (R 4.2.3)
glue 1.6.2 2022-02-24 CRAN (R 4.2.3)
gridtext 0.1.5 2022-09-16 CRAN (R 4.2.3)
gtable 0.3.4 2023-08-21 CRAN (R 4.2.3)
haven 2.5.4 2023-11-30 CRAN (R 4.2.3)
here 1.0.1 2020-12-13 CRAN (R 4.2.3)
hms 1.1.3 2023-03-21 CRAN (R 4.2.3)
htmltools 0.5.7 2023-11-03 CRAN (R 4.2.3)
htmlwidgets 1.6.4 2023-12-06 CRAN (R 4.2.3)
httpuv 1.6.13 2023-12-06 CRAN (R 4.2.3)
httr 1.4.7 2023-08-15 CRAN (R 4.2.3)
insight 0.19.6 2023-10-12 CRAN (R 4.2.3)
jquerylib 0.1.4 2021-04-26 CRAN (R 4.2.3)
jsonlite 1.8.8 2023-12-04 CRAN (R 4.2.3)
kableExtra 1.3.4 2021-02-20 CRAN (R 4.2.3)
knitr 1.45 2023-10-30 CRAN (R 4.2.3)
labelled 2.12.0 2023-06-21 CRAN (R 4.2.3)
later 1.3.2 2023-12-06 CRAN (R 4.2.3)
lattice 0.21-8 2023-04-05 CRAN (R 4.2.2)
lifecycle 1.0.4 2023-11-07 CRAN (R 4.2.3)
lme4 1.1-35.1 2023-11-05 CRAN (R 4.2.3)
lmerTest 3.1-3 2020-10-23 CRAN (R 4.2.3)
lubridate 1.9.3 2023-09-27 CRAN (R 4.2.3)
magick 2.8.1 2023-10-22 CRAN (R 4.2.3)
magrittr 2.0.3 2022-03-30 CRAN (R 4.2.3)
MASS 7.3-60 2023-05-04 CRAN (R 4.2.3)
Matrix 1.6-4 2023-11-30 CRAN (R 4.2.3)
matrixStats 1.1.0 2023-11-07 CRAN (R 4.2.3)
memoise 2.0.1 2021-11-26 CRAN (R 4.2.3)
mime 0.12 2021-09-28 CRAN (R 4.2.0)
miniUI 0.1.1.1 2018-05-18 CRAN (R 4.2.1)
minqa 1.2.6 2023-09-11 CRAN (R 4.2.3)
mnormt 2.1.1 2022-09-26 CRAN (R 4.2.1)
modelr 0.1.11 2023-03-22 CRAN (R 4.2.3)
munsell 0.5.0 2018-06-12 CRAN (R 4.2.1)
mvtnorm 1.2-4 2023-11-27 CRAN (R 4.2.3)
nlme 3.1-162 2023-01-31 CRAN (R 4.2.2)
nloptr 2.0.3 2022-05-26 CRAN (R 4.2.3)
numDeriv 2016.8-1.1 2019-06-06 CRAN (R 4.2.0)
pander 0.6.5 2022-03-18 CRAN (R 4.2.3)
performance 0.10.8 2023-10-30 CRAN (R 4.2.3)
pillar 1.9.0 2023-03-22 CRAN (R 4.2.3)
pkgbuild 1.4.3 2023-12-10 CRAN (R 4.2.3)
pkgconfig 2.0.3 2019-09-22 CRAN (R 4.2.3)
pkgload 1.3.3 2023-09-22 CRAN (R 4.2.3)
plyr 1.8.9 2023-10-02 CRAN (R 4.2.3)
profvis 0.3.8 2023-05-02 CRAN (R 4.2.3)
promises 1.2.1 2023-08-10 CRAN (R 4.2.3)
pryr 0.1.6 2023-01-17 CRAN (R 4.2.3)
psych 2.3.12 2023-12-20 CRAN (R 4.2.2)
purrr 1.0.2 2023-08-10 CRAN (R 4.2.3)
R6 2.5.1 2021-08-19 CRAN (R 4.2.3)
rapportools 1.1 2022-03-22 CRAN (R 4.2.3)
Rcpp 1.0.11 2023-07-06 CRAN (R 4.2.3)
remotes 2.4.2.1 2023-07-18 CRAN (R 4.2.3)
reshape2 1.4.4 2020-04-09 CRAN (R 4.2.3)
rio 1.0.1 2023-09-19 CRAN (R 4.2.3)
rlang 1.1.4 2024-06-04 CRAN (R 4.2.2)
rmarkdown 2.25 2023-09-18 CRAN (R 4.2.3)
rprojroot 2.0.4 2023-11-05 CRAN (R 4.2.3)
rstudioapi 0.15.0 2023-07-07 CRAN (R 4.2.3)
rvest 1.0.3 2022-08-19 CRAN (R 4.2.3)
sass 0.4.8 2023-12-06 CRAN (R 4.2.3)
scales 1.3.0 2023-11-28 CRAN (R 4.2.3)
sessioninfo 1.2.2 2021-12-06 CRAN (R 4.2.3)
shiny 1.8.0 2023-11-17 CRAN (R 4.2.3)
sjlabelled 1.2.0 2022-04-10 CRAN (R 4.2.3)
sjmisc 2.8.9 2021-12-03 CRAN (R 4.2.3)
sjPlot 2.8.15 2023-08-17 CRAN (R 4.2.3)
sjstats 0.18.2 2022-11-19 CRAN (R 4.2.3)
stringi 1.8.3 2023-12-11 CRAN (R 4.2.3)
stringr 1.5.1 2023-11-14 CRAN (R 4.2.3)
summarytools 1.0.1 2022-05-20 CRAN (R 4.2.3)
svglite 2.1.3 2023-12-08 CRAN (R 4.2.3)
systemfonts 1.0.5 2023-10-09 CRAN (R 4.2.3)
tibble 3.2.1 2023-03-20 CRAN (R 4.2.3)
tidyr 1.3.0 2023-01-24 CRAN (R 4.2.3)
tidyselect 1.2.0 2022-10-10 CRAN (R 4.2.1)
timechange 0.2.0 2023-01-11 CRAN (R 4.2.3)
urlchecker 1.0.1 2021-11-30 CRAN (R 4.2.3)
usethis 2.2.2 2023-07-06 CRAN (R 4.2.3)
utf8 1.2.4 2023-10-22 CRAN (R 4.2.3)
vctrs 0.6.5 2023-12-01 CRAN (R 4.2.3)
viridisLite 0.4.2 2023-05-02 CRAN (R 4.2.3)
webshot 0.5.5 2023-06-26 CRAN (R 4.2.3)
withr 2.5.2 2023-10-30 CRAN (R 4.2.3)
xfun 0.41 2023-11-01 CRAN (R 4.2.3)
xml2 1.3.6 2023-12-04 CRAN (R 4.2.3)
xtable 1.8-4 2019-04-21 CRAN (R 4.2.3)
yaml 2.3.8 2023-12-11 CRAN (R 4.2.3)

II. Scale items and Labels

# load in dat files
dat_w1 <- rio::import(paste0(here(), "/data/yw/50130_20110214.sav")) %>%
  mutate(QLogin_1 = tolower(QLogin_1))
dat_w2 <- rio::import(paste0(here(), "/data/yw/50130_2_20110214.sav")) %>%
  mutate(Code = tolower(Code))
dat_w3 <- rio::import(paste0(here(), "/data/yw/50130_3_20110214.sav")) %>%
  mutate(QLogin_1 = tolower(QLogin_1))
ids <- rio::import(paste0(here(), "/data/yw/Survey Codes.xls")) %>%
  rename(couple = `Couple Number`,
         ID = `Survey Codes`) %>%
  mutate(ID = tolower(ID))

# fix NA strings
dat_w1[dat_w1==99999999] <- NA
dat_w2[dat_w2==99999999] <- NA
dat_w3[dat_w3==99999999] <- NA

# fix ID name in dat w2 to match with the others
names(dat_w2)[names(dat_w2) == "Code"] <- "QLogin_1"

# old sex code: 1 = male 2 = female
# new sex code: 1 = female 2 = male
dat_w1$Qd1 <- as.numeric(dat_w1$Qd1 == 2)
dat_w1$Qd1[dat_w1$Qd1 == 0] <- 2

# age as numeric
dat_w1$Qd3_1 <- as.numeric(dat_w1$Qd3_1)

# fix duraction variable
dat_w1$Qd4_1 <- str_replace(string = dat_w1$Qd4_1,
                            pattern = " 1/2",
                            replacement = ".5")
dat_w1$Qd4_1 <- str_replace(string = dat_w1$Qd4_1,
                            pattern = "three and a half",
                            replacement = "3.5")
dat_w1$Qd4_1 <- str_replace(string = dat_w1$Qd4_1,
                            pattern = "4 and a half",
                            replacement = "4.5")
dat_w1$Qd4_1 <- str_remove(string = dat_w1$Qd4_1,
                           pattern = "months|approx|not sure")
dat_w1$Qd4_1 <- as.numeric(dat_w1$Qd4_1)
# BASIC DEMO AND ID ------------------------------------------------------------
basics <- data.frame(
  var_old = names(dat_w1)[grepl("QLogin_1|Qd.*", names(dat_w1))],
  var_new = c(
    "ID",
    "sex",
    "ethnic_black",
    "ethnic_asian",
    "ethnic_white",
    "ethnic_hisp",
    "ethnic_other",
    "ethnic_other_txt",
    "age",
    "duration",
    "rela_status"
  ),
  labels = var_label(dat_w1[, grepl("QLogin_1|Qd.*", names(dat_w1))], unlist = T),
  row.names = NULL
)
basics %>%
  knitr::kable(
    caption = "Basic identifiers and demographics") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Basic identifiers and demographics
var_old var_new labels
QLogin_1 ID Login [General Question: ]
Qd1 sex
Qd2_1 ethnic_black African-American [General Question: What is your ethnicity? Check all that apply]
Qd2_2 ethnic_asian Asian-American [General Question: What is your ethnicity? Check all that apply]
Qd2_3 ethnic_white Caucasian (White) [General Question: What is your ethnicity? Check all that apply]
Qd2_4 ethnic_hisp Hispanic [General Question: What is your ethnicity? Check all that apply]
Qd2_5 ethnic_other Other (Please describe) [General Question: What is your ethnicity? Check all that apply]
Qd2Specified_5 ethnic_other_txt Other (Please describe) Specify [General Question: What is your ethnicity? Check all that apply]
Qd3_1 age
Qd4_1 duration
Qd5 rela_status What is your current dating relationship status?
# BFAS -------------------------------------------------------------------------

# bfas variables for self-report wave 1
bfas_self <- data.frame(
  var_old = names(dat_w1)[grepl("QBFASnIMP.*_A_", names(dat_w1))],
  labels = var_label(dat_w1[,grepl("QBFASnIMP.*_A_", names(dat_w1))], unlist = T),
  row.names = NULL
) %>%
  # remove extra things around the questions
  mutate(labels = str_remove(labels, pattern = " General Question: \\]")) %>%
  mutate(labels = str_remove(labels, pattern = "You \\[")) %>%
  mutate(labels = str_remove(labels, pattern = "[^.]*\\.")) %>%
  mutate(labels = str_remove(labels, pattern = "(\\w+\\s+){1}")) %>%
  mutate(labels = str_remove_all(labels, pattern = "\\."))
bfas_self$var_new <- paste0("bfas_", 1:100)

# bfas variables for self-report longitudinal
bfas_fu <- data.frame(
  var_old = names(dat_w2)[grepl("QOwnPersBFAS.*_A_", names(dat_w2))],
  labels = var_label(dat_w2[,grepl("QOwnPersBFAS.*_A_", names(dat_w2))], unlist = T),
  row.names = NULL
)
# add order to use for arranging after merging
bfas_fu <- bfas_fu %>%
  mutate(order = 1:nrow(bfas_fu)) %>%
  # remove extra things around the questions
  mutate(labels = str_remove(labels, pattern = " General Question: \\]")) %>%
  mutate(labels = str_remove(labels, pattern = " \\[")) %>%
  mutate(labels = str_remove(labels, pattern = "[^.]*\\.")) %>%
  mutate(labels = str_remove(labels, pattern = "(\\w+\\s+){1}")) %>%
  mutate(labels = str_remove_all(labels, pattern = "\\.")) %>%
  merge(subset(bfas_self, select = -var_old), all.x = T, all.y = F, by = "labels") %>%
  arrange(order)
# fix unmatched questions
bfas_fu[grepl("beauty in things that others might not notice", bfas_fu$labels), "var_new"] <- "bfas_100"
bfas_fu[grepl("be bothered with other's needs", bfas_fu$labels), "var_new"] <- "bfas_32"
bfas_fu[grepl("felt depressed", bfas_fu$labels), "var_new"] <- "bfas_41"
bfas_fu[grepl("got irritated", bfas_fu$labels), "var_new"] <- "bfas_16"
bfas_fu[grepl("noticed the emotional aspects of paintings and pictures", bfas_fu$labels), "var_new"] <- "bfas_60"
bfas_fu[grepl("what I started", bfas_fu$labels), "var_new"] <- "bfas_43"
bfas_fu <- bfas_fu %>% select(-c(order))

# bfas variables for other-reports
bfas_partner <- data.frame(
  var_old = names(dat_w1)[grepl("QPartnerBFAS", names(dat_w1))],
  var_new = str_replace(bfas_fu$var_new, "_", "_partner_"),
  labels = str_remove(
    str_remove(
      var_label(dat_w1[, grepl("QPartnerBFAS", names(dat_w1))], unlist= T),
      "General.*"),
    "[^.]*\\."),
  row.names = NULL
)

# double check labels for bfas self and other
bfas_self$labels <- bfas_fu$labels <- NULL
bfas_self$labels <- str_remove(
  str_remove(
    var_label(dat_w1[,grepl("QBFASnIMP.*_A_", names(dat_w1))], unlist = T),
    "General.*"),
  "[^.]*\\.")
bfas_fu$labels <- str_remove(
  str_remove(
    var_label(dat_w2[,grepl("QOwnPersBFAS.*_A_", names(dat_w2))], unlist = T),
    "General.*"),
  "[^.]*\\.")

# keys
bfas_self <- bfas_self %>%
  mutate(keys = ifelse(grepl(
    "_1$|_21$|_41$|_71$|_16$|_36$|_56$|_76$|_2$|_32$|_52$|_62$|_82$|\
    |_17$|_37$|_67$|_77$|_87$|_97$|_13$|_23$|_33$|_53$|_83$|_93$|\
    |_8$|_48$|_68$|_78$|_14$|_24$|_34$|_54$|_64$|_29$|_49$|_79$|_99$|\
    |_15$|_45$|_55$|_85$|_50$|_60$|_80$|_90", var_new),
    -1, 1))
bfas_fu <- bfas_fu %>%
  mutate(keys = ifelse(grepl(
    "_1$|_21$|_41$|_71$|_16$|_36$|_56$|_76$|_2$|_32$|_52$|_62$|_82$|\
    |_17$|_37$|_67$|_77$|_87$|_97$|_13$|_23$|_33$|_53$|_83$|_93$|\
    |_8$|_48$|_68$|_78$|_14$|_24$|_34$|_54$|_64$|_29$|_49$|_79$|_99$|\
    |_15$|_45$|_55$|_85$|_50$|_60$|_80$|_90", var_new),
    -1, 1))
bfas_partner <- bfas_partner %>%
  mutate(keys = ifelse(grepl(
    "_1$|_21$|_41$|_71$|_16$|_36$|_56$|_76$|_2$|_32$|_52$|_62$|_82$|\
    |_17$|_37$|_67$|_77$|_87$|_97$|_13$|_23$|_33$|_53$|_83$|_93$|\
    |_8$|_48$|_68$|_78$|_14$|_24$|_34$|_54$|_64$|_29$|_49$|_79$|_99$|\
    |_15$|_45$|_55$|_85$|_50$|_60$|_80$|_90", var_new),
    -1, 1))

# scale scores
bfas_self <- bfas_self %>%
  mutate(subscale = case_when(
    grepl("1$|6$", var_new) ~ "neuroticism",
    grepl("2$|7$", var_new) ~ "agreeableness",
    grepl("3$|8$", var_new) ~ "conscientiousness",
    grepl("4$|9$", var_new) ~ "extraversion",
    grepl("5$|0$", var_new) ~ "openness"))
bfas_fu <- bfas_fu %>%
  mutate(subscale = case_when(
    grepl("1$|6$", var_new) ~ "neuroticism",
    grepl("2$|7$", var_new) ~ "agreeableness",
    grepl("3$|8$", var_new) ~ "conscientiousness",
    grepl("4$|9$", var_new) ~ "extraversion",
    grepl("5$|0$", var_new) ~ "openness"))
bfas_partner <- bfas_partner %>%
  mutate(subscale = case_when(
    grepl("1$|6$", var_new) ~ "neuroticism",
    grepl("2$|7$", var_new) ~ "agreeableness",
    grepl("3$|8$", var_new) ~ "conscientiousness",
    grepl("4$|9$", var_new) ~ "extraversion",
    grepl("5$|0$", var_new) ~ "openness"))

# print dict
bfas_self %>%
  knitr::kable(
    caption = "BFAS labels and item names for self-report at wave 1") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
BFAS labels and item names for self-report at wave 1
var_old var_new labels keys subscale
QBFASnIMP1_A_1 bfas_1 Seldom feel blue. -1 neuroticism
QBFASnIMP1_A_2 bfas_2 Am not interested in other people’s problems. -1 agreeableness
QBFASnIMP1_A_3 bfas_3 Carry out my plans. 1 conscientiousness
QBFASnIMP1_A_4 bfas_4 Make friends easily. 1 extraversion
QBFASnIMP1_A_5 bfas_5 Am quick to understand things. 1 openness
QBFASnIMP1_A_6 bfas_6 Get angry easily. 1 neuroticism
QBFASnIMP1_A_7 bfas_7 Respect authority. 1 agreeableness
QBFASnIMP1_A_8 bfas_8 Leave my belongings around. -1 conscientiousness
QBFASnIMP1_A_9 bfas_9 Take charge. 1 extraversion
QBFASnIMP1_A_10 bfas_10 Enjoy the beauty of nature. 1 openness
QBFASnIMP1_A_11 bfas_11 Am filled with doubts about things. 1 neuroticism
QBFASnIMP1_A_12 bfas_12 Feel others’ emotions. 1 agreeableness
QBFASnIMP1_A_13 bfas_13 Waste my time. -1 conscientiousness
QBFASnIMP1_A_14 bfas_14 Am hard to get to know. -1 extraversion
QBFASnIMP1_A_15 bfas_15 Have difficulty understanding abstract ideas. -1 openness
QBFASnIMP1_A_16 bfas_16 Rarely get irritated. -1 neuroticism
QBFASnIMP1_A_17 bfas_17 Believe that I am better than others. -1 agreeableness
QBFASnIMP1_A_18 bfas_18 Like order. 1 conscientiousness
QBFASnIMP1_A_19 bfas_19 Have a strong personality. 1 extraversion
QBFASnIMP1_A_20 bfas_20 Believe in the importance of art. 1 openness
QBFASnIMP2_A_1 bfas_21 Feel comfortable with myself. -1 neuroticism
QBFASnIMP2_A_2 bfas_22 Inquire about others’ well-being. 1 agreeableness
QBFASnIMP2_A_3 bfas_23 Find it difficult to get down to work. -1 conscientiousness
QBFASnIMP2_A_4 bfas_24 Keep others at a distance. -1 extraversion
QBFASnIMP2_A_5 bfas_25 Can handle a lot of information. 1 openness
QBFASnIMP2_A_6 bfas_26 Get upset easily. 1 neuroticism
QBFASnIMP2_A_7 bfas_27 Hate to seem pushy. 1 agreeableness
QBFASnIMP2_A_8 bfas_28 Keep things tidy. 1 conscientiousness
QBFASnIMP2_A_9 bfas_29 Lack the talent for influencing people. -1 extraversion
QBFASnIMP2_A_10 bfas_30 Love to reflect on things. 1 openness
QBFASnIMP2_A_11 bfas_31 Feel threatened easily. 1 neuroticism
QBFASnIMP2_A_12 bfas_32 Can’t be bothered with other’s needs. -1 agreeableness
QBFASnIMP2_A_13 bfas_33 Mess things up. -1 conscientiousness
QBFASnIMP2_A_14 bfas_34 Reveal little about myself. -1 extraversion
QBFASnIMP2_A_15 bfas_35 Like to solve complex problems. 1 openness
QBFASnIMP2_A_16 bfas_36 Keep my emotions under control. -1 neuroticism
QBFASnIMP2_A_17 bfas_37 Take advantage of others. -1 agreeableness
QBFASnIMP2_A_18 bfas_38 Follow a schedule. 1 conscientiousness
QBFASnIMP2_A_19 bfas_39 Know how to captivate people. 1 extraversion
QBFASnIMP2_A_20 bfas_40 Get deeply immersed in music. 1 openness
QBFASnIMP3_A_1 bfas_41 Rarely feel depressed. -1 neuroticism
QBFASnIMP3_A_2 bfas_42 Sympathize with others’ feelings. 1 agreeableness
QBFASnIMP3_A_3 bfas_43 Finish what I start. 1 conscientiousness
QBFASnIMP3_A_4 bfas_44 Warm up quickly to others. 1 extraversion
QBFASnIMP3_A_5 bfas_45 Avoid philosophical discussions. -1 openness
QBFASnIMP3_A_6 bfas_46 Change my mood a lot. 1 neuroticism
QBFASnIMP3_A_7 bfas_47 Avoid imposing my will on others. 1 agreeableness
QBFASnIMP3_A_8 bfas_48 Am not bothered by messy people. -1 conscientiousness
QBFASnIMP3_A_9 bfas_49 Wait for others to lead the way. -1 extraversion
QBFASnIMP3_A_10 bfas_50 Do not like poetry. -1 openness
QBFASnIMP3_A_11 bfas_51 Worry about things. 1 neuroticism
QBFASnIMP3_A_12 bfas_52 Am indifferent to the feelings of others. -1 agreeableness
QBFASnIMP3_A_13 bfas_53 Don’t put my mind on the task at hand. -1 conscientiousness
QBFASnIMP3_A_14 bfas_54 Rarely get caught up in the excitement. -1 extraversion
QBFASnIMP3_A_15 bfas_55 Avoid difficult reading material. -1 openness
QBFASnIMP3_A_16 bfas_56 Rarely lose my composure. -1 neuroticism
QBFASnIMP3_A_17 bfas_57 Rarely put people under pressure. 1 agreeableness
QBFASnIMP3_A_18 bfas_58 Want everything to be “just right.” 1 conscientiousness
QBFASnIMP3_A_19 bfas_59 See myself as a good leader. 1 extraversion
QBFASnIMP3_A_20 bfas_60 Seldom notice the emotional aspects of paintings and pictures. -1 openness
QBFASnIMP4_A_1 bfas_61 Am easily discouraged. 1 neuroticism
QBFASnIMP4_A_2 bfas_62 Take no time for others. -1 agreeableness
QBFASnIMP4_A_3 bfas_63 Get things done quickly. 1 conscientiousness
QBFASnIMP4_A_4 bfas_64 Am not a very enthusiastic person. -1 extraversion
QBFASnIMP4_A_5 bfas_65 Have a rich vocabulary. 1 openness
QBFASnIMP4_A_6 bfas_66 Am a person whose moods go up and down easily. 1 neuroticism
QBFASnIMP4_A_7 bfas_67 Insult people. -1 agreeableness
QBFASnIMP4_A_8 bfas_68 Am not bothered by disorder. -1 conscientiousness
QBFASnIMP4_A_9 bfas_69 Can talk others into doing things. 1 extraversion
QBFASnIMP4_A_10 bfas_70 Need a creative outlet. 1 openness
QBFASnIMP4_A_11 bfas_71 Am not embarrassed easily. -1 neuroticism
QBFASnIMP4_A_12 bfas_72 Take an interest in other people’s lives. 1 agreeableness
QBFASnIMP4_A_13 bfas_73 Always know what I am doing. 1 conscientiousness
QBFASnIMP4_A_14 bfas_74 Show my feelings when I’m happy. 1 extraversion
QBFASnIMP4_A_15 bfas_75 Think quickly. 1 openness
QBFASnIMP4_A_16 bfas_76 Am not easily annoyed. -1 neuroticism
QBFASnIMP4_A_17 bfas_77 Seek conflict. -1 agreeableness
QBFASnIMP4_A_18 bfas_78 Dislike routine. -1 conscientiousness
QBFASnIMP4_A_19 bfas_79 Hold back my opinions. -1 extraversion
QBFASnIMP4_A_20 bfas_80 Seldom get lost in thought. -1 openness
QBFASnIMP5_A_1 bfas_81 Become overwhelmed by events. 1 neuroticism
QBFASnIMP5_A_2 bfas_82 Don’t have a soft side. -1 agreeableness
QBFASnIMP5_A_3 bfas_83 Postpone decisions. -1 conscientiousness
QBFASnIMP5_A_4 bfas_84 Have a lot of fun. 1 extraversion
QBFASnIMP5_A_5 bfas_85 Learn things slowly. -1 openness
QBFASnIMP5_A_6 bfas_86 Get easily agitated. 1 neuroticism
QBFASnIMP5_A_7 bfas_87 Love a good fight. -1 agreeableness
QBFASnIMP5_A_8 bfas_88 See that rules are observed. 1 conscientiousness
QBFASnIMP5_A_9 bfas_89 Am the first to act. 1 extraversion
QBFASnIMP5_A_10 bfas_90 Seldom daydream. -1 openness
QBFASnIMP5_A_11 bfas_91 Am afraid of many things. 1 neuroticism
QBFASnIMP5_A_12 bfas_92 Like to do things for others. 1 agreeableness
QBFASnIMP5_A_13 bfas_93 Am easily distracted. -1 conscientiousness
QBFASnIMP5_A_14 bfas_94 Laugh a lot. 1 extraversion
QBFASnIMP5_A_15 bfas_95 Formulate ideas clearly. 1 openness
QBFASnIMP5_A_16 bfas_96 Can be stirred up easily. 1 neuroticism
QBFASnIMP5_A_17 bfas_97 Am out for my own personal gain. -1 agreeableness
QBFASnIMP5_A_18 bfas_98 Want every detail taken care of. 1 conscientiousness
QBFASnIMP5_A_19 bfas_99 Do not have an assertive personality. -1 extraversion
QBFASnIMP5_A_20 bfas_100 See beauty in things that others might not notice. 1 openness
bfas_fu %>%
  knitr::kable(
    caption = "BFAS labels and item names for self-reports at waves 2 and 3") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
BFAS labels and item names for self-reports at waves 2 and 3
var_old var_new labels keys subscale
QOwnPersBFAS1_A_1 bfas_51 Worried about things 1 neuroticism
QOwnPersBFAS1_A_2 bfas_72 Took an interest in other people’s lives. 1 agreeableness
QOwnPersBFAS1_A_3 bfas_3 Carried out my plans. 1 conscientiousness
QOwnPersBFAS1_A_4 bfas_84 Had a lot of fun 1 extraversion
QOwnPersBFAS1_A_5 bfas_5 Was quick to understand things. 1 openness
QOwnPersBFAS1_A_6 bfas_66 Was a person whose moods go up and down easily. 1 neuroticism
QOwnPersBFAS1_A_7 bfas_67 Insulted people. -1 agreeableness
QOwnPersBFAS1_A_8 bfas_8 Left my belongings around. -1 conscientiousness
QOwnPersBFAS1_A_9 bfas_9 Took charge. 1 extraversion
QOwnPersBFAS1_A_10 bfas_100 Saw beauty in things that others might not notice. 1 openness
QOwnPersBFAS1_A_11 bfas_41 Rarely felt depressed. -1 neuroticism
QOwnPersBFAS1_A_12 bfas_52 Was indifferent to the feelings of others -1 agreeableness
QOwnPersBFAS1_A_13 bfas_13 Wasted my time. -1 conscientiousness
QOwnPersBFAS1_A_14 bfas_64 Was not a very enthusiastic person. -1 extraversion
QOwnPersBFAS1_A_15 bfas_15 Had difficulty understanding abstract ideas. -1 openness
QOwnPersBFAS1_A_16 bfas_16 Rarely got irritated. -1 neuroticism
QOwnPersBFAS1_A_17 bfas_77 Sought conflict. -1 agreeableness
QOwnPersBFAS1_A_18 bfas_18 Liked order. 1 conscientiousness
QOwnPersBFAS1_A_19 bfas_99 Did not have an assertive personality. -1 extraversion
QOwnPersBFAS1_A_20 bfas_20 Believed in the importance of art. 1 openness
QOwnPersBFAS2_A_1 bfas_21 Felt comfortable with myself. -1 neuroticism
QOwnPersBFAS2_A_2 bfas_42 Sympathized with others’ feelings. 1 agreeableness
QOwnPersBFAS2_A_3 bfas_23 Found it difficult to get down to work. -1 conscientiousness
QOwnPersBFAS2_A_4 bfas_24 Kept others at a distance. -1 extraversion
QOwnPersBFAS2_A_5 bfas_95 Formulated ideas clearly. 1 openness
QOwnPersBFAS2_A_6 bfas_6 Got angry easily. 1 neuroticism
QOwnPersBFAS2_A_7 bfas_57 Rarely put people under pressure. 1 agreeableness
QOwnPersBFAS2_A_8 bfas_98 Wanted every detail taken care of. 1 conscientiousness
QOwnPersBFAS2_A_9 bfas_79 Held back my opinions. -1 extraversion
QOwnPersBFAS2_A_10 bfas_60 Seldom noticed the emotional aspects of paintings and pictures. -1 openness
QOwnPersBFAS2_A_11 bfas_31 Felt threatened easily. 1 neuroticism
QOwnPersBFAS2_A_12 bfas_32 Couldn’t be bothered with other’s needs. -1 agreeableness
QOwnPersBFAS2_A_13 bfas_43 Finished what I started. 1 conscientiousness
QOwnPersBFAS2_A_14 bfas_44 Warmed up quickly to others. 1 extraversion
QOwnPersBFAS2_A_15 bfas_85 Learned things slowly. -1 openness
QOwnPersBFAS2_A_16 bfas_36 Kept my emotions under control. -1 neuroticism
QOwnPersBFAS2_A_17 bfas_47 Avoided imposing my will on others. 1 agreeableness
QOwnPersBFAS2_A_18 bfas_78 Disliked routine. -1 conscientiousness
QOwnPersBFAS2_A_19 bfas_59 Saw myself as a good leader. 1 extraversion
QOwnPersBFAS2_A_20 bfas_50 Did not like poetry. -1 openness
bfas_partner %>%
  knitr::kable(
    caption = "BFAS labels and item names for partner-reports") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
BFAS labels and item names for partner-reports
var_old var_new labels keys subscale
QPartnerBFAS_A_1 bfas_partner_51 Worried about things 1 neuroticism
QPartnerBFAS_A_2 bfas_partner_72 Took an interest in other people’s lives. 1 agreeableness
QPartnerBFAS_A_3 bfas_partner_3 Carried out his/her plans. 1 conscientiousness
QPartnerBFAS_A_4 bfas_partner_84 Had a lot of fun 1 extraversion
QPartnerBFAS_A_5 bfas_partner_5 Was quick to understand things. 1 openness
QPartnerBFAS_A_6 bfas_partner_66 Was a person whose moods go up and down easily. 1 neuroticism
QPartnerBFAS_A_7 bfas_partner_67 Insulted people. -1 agreeableness
QPartnerBFAS_A_8 bfas_partner_8 Left his/her belongings around. -1 conscientiousness
QPartnerBFAS_A_9 bfas_partner_9 Took charge. 1 extraversion
QPartnerBFAS_A_10 bfas_partner_100 Saw beauty in things that others might not notice. 1 openness
QPartnerBFAS_A_11 bfas_partner_41 Rarely felt depressed. -1 neuroticism
QPartnerBFAS_A_12 bfas_partner_52 Was indifferent to the feelings of others -1 agreeableness
QPartnerBFAS_A_13 bfas_partner_13 Wasted his/her time. -1 conscientiousness
QPartnerBFAS_A_14 bfas_partner_64 Was not a very enthusiastic person. -1 extraversion
QPartnerBFAS_A_15 bfas_partner_15 Had difficulty understanding abstract ideas. -1 openness
QPartnerBFAS_A_16 bfas_partner_16 Rarely got irritated. -1 neuroticism
QPartnerBFAS_A_17 bfas_partner_77 Sought conflict. -1 agreeableness
QPartnerBFAS_A_18 bfas_partner_18 Liked order. 1 conscientiousness
QPartnerBFAS_A_19 bfas_partner_99 Did not have an assertive personality. -1 extraversion
QPartnerBFAS_A_20 bfas_partner_20 Believed in the importance of art. 1 openness
QPartnerBFAS_A_21 bfas_partner_21 Felt comfortable with him/herself. -1 neuroticism
QPartnerBFAS_A_22 bfas_partner_42 Sympathized with others’ feelings. 1 agreeableness
QPartnerBFAS_A_23 bfas_partner_23 Found it difficult to get down to work. -1 conscientiousness
QPartnerBFAS_A_24 bfas_partner_24 Kept others at a distance. -1 extraversion
QPartnerBFAS_A_25 bfas_partner_95 Formulated ideas clearly. 1 openness
QPartnerBFAS_A_26 bfas_partner_6 Got angry easily. 1 neuroticism
QPartnerBFAS_A_27 bfas_partner_57 Rarely put people under pressure. 1 agreeableness
QPartnerBFAS_A_28 bfas_partner_98 Wanted every detail taken care of. 1 conscientiousness
QPartnerBFAS_A_29 bfas_partner_79 Held back his/her opinions. -1 extraversion
QPartnerBFAS_A_30 bfas_partner_60 Seldom noticed the emotional aspects of paintings and pictures. -1 openness
QPartnerBFAS_A_31 bfas_partner_31 Felt threatened easily. 1 neuroticism
QPartnerBFAS_A_32 bfas_partner_32 Couldn’t be bothered with other’s needs. -1 agreeableness
QPartnerBFAS_A_33 bfas_partner_43 Finished what he/she started. 1 conscientiousness
QPartnerBFAS_A_34 bfas_partner_44 Warmed up quickly to others. 1 extraversion
QPartnerBFAS_A_35 bfas_partner_85 Learned things slowly. -1 openness
QPartnerBFAS_A_36 bfas_partner_36 Kept his/her emotions nder control. -1 neuroticism
QPartnerBFAS_A_37 bfas_partner_47 Avoided imposing his/her will on others. 1 agreeableness
QPartnerBFAS_A_38 bfas_partner_78 Disliked routine. -1 conscientiousness
QPartnerBFAS_A_39 bfas_partner_59 Saw him/herself as a good leader. 1 extraversion
QPartnerBFAS_A_40 bfas_partner_50 Did not like poetry. -1 openness
# AAQ --------------------------------------------------------------------------
# reverse items: 1, 3, 4, 12, 14, 16, 17
aaq_keys <- rep(1, 17)
aaq_keys[c(1, 3, 4, 12, 14, 16, 17)] <- -1

aaq <- data.frame(
  var_old = names(dat_w1)[grepl("QAAQ", names(dat_w1))],
  var_new = paste0("aaq_", 1:17),
  keys = aaq_keys,
  labels = str_remove(
    str_remove(
      var_label(dat_w1[,grepl("QAAQ", names(dat_w1))], unlist = T),
      "General.*"),
    "[^.]*\\."),
  row.names = NULL
)

# scale scores
# avoidance items: 1-3 and 5-9
# anxiety items: everything else
aaq <- aaq %>%
  mutate(subscale = ifelse(grepl("_1$|_2$|_3$|_5$|_6$|_7$|_8$|_9$", var_new),
                           "avoidance",
                           "anxiety"))
# print dict
aaq %>%
  knitr::kable(
    caption = "AAQ labels and item names") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
AAQ labels and item names
var_old var_new keys labels subscale
QAAQ_A_1 aaq_1 -1 I find it relatively easy to get close to others. avoidance
QAAQ_A_2 aaq_2 1 I’m not very comfortable having to depend on other people. avoidance
QAAQ_A_3 aaq_3 -1 I’m comfortable having others depend on me. avoidance
QAAQ_A_4 aaq_4 -1 I rarely worry about being abandoned by others. anxiety
QAAQ_A_5 aaq_5 1 I don’t like people getting too close to me. avoidance
QAAQ_A_6 aaq_6 1 I’m somewhat uncomfortable being too close to others. avoidance
QAAQ_A_7 aaq_7 1 I find it difficult to trust others completely. avoidance
QAAQ_A_8 aaq_8 1 I’m nervous whenever anyone gets too close to me. avoidance
QAAQ_A_9 aaq_9 1 Others often want me to be more intimate than I feel comfortable being. avoidance
QAAQ_A_10 aaq_10 1 Others often are reluctant to get as close as I would like. anxiety
QAAQ_A_11 aaq_11 1 I often worry that my partner(s) don’t really love me. anxiety
QAAQ_A_12 aaq_12 -1 I rarely worry about my partner(s) leaving me. anxiety
QAAQ_A_13 aaq_13 1 I often want to merge completely with others, and this desire sometimes scares them away. anxiety
QAAQ_A_14 aaq_14 -1 I’m confident others would never hurt me by suddenly ending our relationship. anxiety
QAAQ_A_15 aaq_15 1 I usually want more closeness and intimacy than others do. anxiety
QAAQ_A_16 aaq_16 -1 The thought of being left by others rarely enters my mind. anxiety
QAAQ_A_17 aaq_17 -1 I’m confident that my partner(s) love me just as much as I love them. anxiety
# Responsiveness ---------------------------------------------------------------
resp <- data.frame(
  var_old = names(dat_w1)[grepl("QResponsiveness", names(dat_w1))],
  var_new = paste0("resp_", 1:18),
  labels = str_remove(
    str_remove(
      var_label(dat_w1[,grepl("QResponsiveness", names(dat_w1))], unlist = T),
      "General.*"),
    "[^.]*\\."),
  row.names = NULL
)
resp %>%
  knitr::kable(
    caption = "Responsiveness labels and item names") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Responsiveness labels and item names
var_old var_new labels
QResponsiveness_A_1 resp_1 … is an excellent judge of my character.
QResponsiveness_A_2 resp_2 … sees the “real” me.
QResponsiveness_A_3 resp_3 … sees the same virtues and faults in me as I see in myself.
QResponsiveness_A_4 resp_4 … “gets the facts right” about me.
QResponsiveness_A_5 resp_5 … esteems me, shortcomings and all.
QResponsiveness_A_6 resp_6 … knows me well.
QResponsiveness_A_7 resp_7 … values and respects the whole package that is the “real” me.
QResponsiveness_A_8 resp_8 … usually seems to focus on the “best side” of me.
QResponsiveness_A_9 resp_9 … is aware of what I am thinking and feeling
QResponsiveness_A_10 resp_10 … understands me.
QResponsiveness_A_11 resp_11 … really listens to me.
QResponsiveness_A_12 resp_12 … expresses liking and encouragement for me.
QResponsiveness_A_13 resp_13 … seems interested in what I am thinking and feeling.
QResponsiveness_A_14 resp_14 … seems interested in doing things with me.
QResponsiveness_A_15 resp_15 … values my abilities and opinions.
QResponsiveness_A_16 resp_16 … is on “the same wavelength” with me.
QResponsiveness_A_17 resp_17 … respects me.
QResponsiveness_A_18 resp_18 … is responsive to my needs.
# Trust ------------------------------------------------------------------------
# reverse items: 4, 5, 6, 14
trust_keys <- rep(1, 17)
trust_keys[c(4, 5, 6, 14)] <- -1

trust <- data.frame(
  var_old = names(dat_w1)[grepl("Qtrust", names(dat_w1))],
  var_new = paste0("trust_", 1:17),
  keys = trust_keys,
  labels = str_remove(
    str_remove(
      var_label(dat_w1[,grepl("Qtrust", names(dat_w1))], unlist = T),
      "General.*"),
    "[^.]*\\."),
  row.names = NULL
)
trust %>%
  knitr::kable(
    caption = "Trust scale labels and item names") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Trust scale labels and item names
var_old var_new keys labels
Qtrust_A_1 trust_1 1 Romantic partners are trustworthy and I am willing to let them engage in activities which other people find
Qtrust_A_2 trust_2 1 Even when I don’t know how romantic partners will react, I feel comfortable telling them anything about myse
Qtrust_A_3 trust_3 1 Though times may change and the future is uncertain, I know my romantic partners will always be ready and wi
Qtrust_A_4 trust_4 -1 I am never certain that romantic partners won’t do something that I dislike or will embarrass me.
Qtrust_A_5 trust_5 -1 Romantic partners are very unpredictable. I never know how they are going to act from one day to the next. G
Qtrust_A_6 trust_6 -1 I feel very uncomfortable when romantic partners have to make decisions which will affect me personally. Gen
Qtrust_A_7 trust_7 1 I have found that romantic partners are unusually dependable, especially when it comes to things which are i
Qtrust_A_8 trust_8 1 In general, romantic partners behave in a very consistent manner.
Qtrust_A_9 trust_9 1 Whenever I have to make an important decision with romantic partners in a situation we have never encountere
Qtrust_A_10 trust_10 1 Even if I have no reason to expect romantic partners to share things with me, I still feel certain that the
Qtrust_A_11 trust_11 1 I can rely on romantic partners to react in a positive way when I expose my weaknesses to them.
Qtrust_A_12 trust_12 1 When I share my problems with romantic partners, I know they will respond in a loving way, even before I sa
Qtrust_A_13 trust_13 1 I am certain that romantic partners would not cheat on me, even if the opportunity arose and there was no c
Qtrust_A_14 trust_14 -1 I sometimes avoid romantic partners because they are unpredictable and I fear saying or doing something whi
Qtrust_A_15 trust_15 1 I can rely on romantic partners to keep the promises they make to me.
Qtrust_A_16 trust_16 1 When I am with romantic partners, I feel secure in facing unknown new situations.
Qtrust_A_17 trust_17 1 Even when romantic partners make excuses which sound rather unlikely, I am confident that they are telling
# PRQC -------------------------------------------------------------------------
prqc <- data.frame(
  var_old = names(dat_w1)[grepl("QPRQC", names(dat_w1))],
  var_new = paste0("prqc_", 1:18),
  labels = str_remove(
    str_remove(
      var_label(dat_w1[,grepl("QPRQC", names(dat_w1))], unlist = T),
      "General.*"),
    "[^.]*\\."),
  row.names = NULL
) %>%
  filter(grepl(pattern = "_1$|_4$|_7$|_10$|_13$|_16$",
               x = var_new))

# scale scores
prqc <- prqc %>%
  mutate(subscale = c("satisfaction", "commitment", "intimacy",
                      "trust", "passion", "love"))

prqc %>%
  knitr::kable(
    caption = "PRQC scale labels and item names") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
PRQC scale labels and item names
var_old var_new labels subscale
QPRQC1_A_1 prqc_1 How satisfied are you with your relationship? satisfaction
QPRQC2_A_1 prqc_4 How committed are you to your relationship? commitment
QPRQC3_A_1 prqc_7 How intimate is your relationship? intimacy
QPRQC4_A_1 prqc_10 How much do you trust your partner? trust
QPRQC5_A_1 prqc_13 How passionate is your relationship? passion
QPRQC6_A_1 prqc_16 How much do you love your partner? love
# RENAMING ---------------------------------------------------------------------

# based on variable names data frames
# demographics and id
names(dat_w1)[match(basics$var_old, names(dat_w1))] <- basics$var_new
names(dat_w2)[match(basics$var_old[1], names(dat_w2))] <- basics$var_new[1]
names(dat_w3)[match(basics$var_old[1], names(dat_w3))] <- basics$var_new[1]

# bfas self
names(dat_w1)[match(bfas_self$var_old, names(dat_w1))] <- bfas_self$var_new
names(dat_w2)[match(bfas_fu$var_old, names(dat_w2))] <- bfas_fu$var_new
names(dat_w3)[match(bfas_fu$var_old, names(dat_w3))] <- bfas_fu$var_new

# all other scales
names(dat_w1)[match(bfas_partner$var_old, names(dat_w1))] <- bfas_partner$var_new
names(dat_w1)[match(aaq$var_old, names(dat_w1))] <- aaq$var_new
names(dat_w1)[match(resp$var_old, names(dat_w1))] <- resp$var_new
names(dat_w1)[match(trust$var_old, names(dat_w1))] <- trust$var_new
names(dat_w1)[match(prqc$var_old, names(dat_w1))] <- prqc$var_new
names(dat_w2)[match(bfas_partner$var_old, names(dat_w2))] <- bfas_partner$var_new
names(dat_w2)[match(aaq$var_old, names(dat_w2))] <- aaq$var_new
names(dat_w2)[match(resp$var_old, names(dat_w2))] <- resp$var_new
names(dat_w2)[match(trust$var_old, names(dat_w2))] <- trust$var_new
names(dat_w2)[match(prqc$var_old, names(dat_w2))] <- prqc$var_new
names(dat_w3)[match(bfas_partner$var_old, names(dat_w3))] <- bfas_partner$var_new
names(dat_w3)[match(aaq$var_old, names(dat_w3))] <- aaq$var_new
names(dat_w3)[match(resp$var_old, names(dat_w3))] <- resp$var_new
names(dat_w3)[match(trust$var_old, names(dat_w3))] <- trust$var_new
names(dat_w3)[match(prqc$var_old, names(dat_w3))] <- prqc$var_new

# select only relevant variables
dat_w1 <- dat_w1 %>%
  select(all_of(c(basics$var_new, bfas_self$var_new, bfas_partner$var_new, 
                  aaq$var_new, resp$var_new, trust$var_new, prqc$var_new)))
dat_w2 <- dat_w2 %>%
  select(all_of(c(basics$var_new[1], bfas_fu$var_new, bfas_partner$var_new, 
                  aaq$var_new, resp$var_new, trust$var_new, prqc$var_new)))
dat_w3 <- dat_w3 %>%
  select(all_of(c(basics$var_new[1], bfas_fu$var_new, bfas_partner$var_new, 
                  aaq$var_new, resp$var_new, trust$var_new, prqc$var_new)))

III. Descriptives: Scale scoring and summary statistics

# reverse scores ---------------------------------------------------------------
# pull out reversed items for each scale
reverse_bfas_w1 <- c(
  bfas_self[bfas_self$keys == -1, "var_new"],
  bfas_partner[bfas_partner$keys == -1, "var_new"]
)
reverse_bfas_fu <- c(
  bfas_fu[bfas_fu$keys == -1, "var_new"],
  bfas_partner[bfas_partner$keys == -1, "var_new"]
)
reverse_aaq <- aaq[aaq$keys == -1, "var_new"]
reverse_trust <- trust[trust$keys == -1, "var_new"]
# reverse scores
dat_w1[, reverse_bfas_w1] <- 6 - dat_w1[, reverse_bfas_w1]
dat_w2[, reverse_bfas_fu] <- 6 - dat_w2[, reverse_bfas_fu]
dat_w3[, reverse_bfas_fu] <- 6 - dat_w3[, reverse_bfas_fu]
dat_w1[, reverse_aaq] <- 8 - dat_w1[, reverse_aaq]
dat_w2[, reverse_aaq] <- 8 - dat_w2[, reverse_aaq]
dat_w3[, reverse_aaq] <- 8 - dat_w3[, reverse_aaq]
dat_w1[, reverse_trust] <- 8 - dat_w1[, reverse_trust]
dat_w2[, reverse_trust] <- 8 - dat_w2[, reverse_trust]
dat_w3[, reverse_trust] <- 8 - dat_w3[, reverse_trust]


# BFAS -------------------------------------------------------------------------
for(var in unique(bfas_self$subscale)) {
  
  ### wave 1 ###
  
  # pull out item variables
  self_items <- bfas_self[bfas_self$subscale == var, "var_new"]
  self_df <- dat_w1[, names(dat_w1) %in% self_items]
  partner_items <- bfas_partner[bfas_partner$subscale == var, "var_new"]
  partner_df <- dat_w1[, names(dat_w1) %in% partner_items]
  
  # create and append scale scores
  assign(x = paste0(var, "_self"), value = rowMeans(self_df, na.rm = T))
  dat_w1[paste0(var, "_self")] <- get(paste0(var, "_self"))
  assign(x = paste0(var, "_partner"), value = rowMeans(partner_df, na.rm = T))
  dat_w1[paste0(var, "_partner")] <- get(paste0(var, "_partner"))
  
  # output alphas
  cat(paste(var, "Cronbach's alpha =", 
            round(psych::alpha(self_df)$total["raw_alpha"], 2), "\n"))
  
  ### wave 2 and 3 ### 
  self_items_fu <- bfas_fu[bfas_fu$subscale == var, "var_new"]
  self_df_w2 <- dat_w2[, names(dat_w2) %in% self_items_fu]
  self_df_w3 <- dat_w3[, names(dat_w3) %in% self_items_fu]
  partner_df_w2 <- dat_w2[, names(dat_w2) %in% partner_items]
  partner_df_w3 <- dat_w3[, names(dat_w3) %in% partner_items]

  # create and append scale scores
  assign(x = paste0(var, "_self"), value = rowMeans(self_df_w2, na.rm = T))
  dat_w2[paste0(var, "_self")] <- get(paste0(var, "_self"))
  assign(x = paste0(var, "_self"), value = rowMeans(self_df_w3, na.rm = T))
  dat_w3[paste0(var, "_self")] <- get(paste0(var, "_self"))
  assign(x = paste0(var, "_partner"), value = rowMeans(partner_df_w2, na.rm = T))
  dat_w2[paste0(var, "_partner")] <- get(paste0(var, "_partner"))
  assign(x = paste0(var, "_partner"), value = rowMeans(partner_df_w3, na.rm = T))
  dat_w3[paste0(var, "_partner")] <- get(paste0(var, "_partner"))
}
## neuroticism Cronbach's alpha = 0.88 
## agreeableness Cronbach's alpha = 0.81 
## conscientiousness Cronbach's alpha = 0.82 
## extraversion Cronbach's alpha = 0.87 
## openness Cronbach's alpha = 0.81
# AAQ --------------------------------------------------------------------------
for (var in unique(aaq$subscale)) {
  
  # pull out item variables
  aaq_items <- aaq[aaq$subscale == var, "var_new"]
  aaq_df <- dat_w1[, names(dat_w1) %in% aaq_items]
  aaq_df_w2 <- dat_w2[, names(dat_w2) %in% aaq_items]
  aaq_df_w3 <- dat_w3[, names(dat_w3) %in% aaq_items]
  
  # create and append scale scores
  assign(x = var, value = rowMeans(aaq_df, na.rm = T))
  dat_w1[var] <- get(var)
  assign(x = var, value = rowMeans(aaq_df_w2, na.rm = T))
  dat_w2[var] <- get(var)
  assign(x = var, value = rowMeans(aaq_df_w3, na.rm = T))
  dat_w3[var] <- get(var)
  
  # output alphas
  cat(paste(var, "Cronbach's alpha =", 
            round(psych::alpha(aaq_df)$total["raw_alpha"], 2), "\n"))
}
## avoidance Cronbach's alpha = 0.8 
## anxiety Cronbach's alpha = 0.76
# Responsiveness ---------------------------------------------------------------
# wave 1
resp_items <- resp$var_new
resp_df <- dat_w1[, names(dat_w1) %in% resp_items]
assign(x = "resp_scale", value = rowMeans(resp_df, na.rm = T))
dat_w1["resp"] <- resp_scale

# output alphas
cat(paste("Responsiveness Cronbach's alpha =", 
          round(psych::alpha(resp_df)$total["raw_alpha"], 2)))
## Responsiveness Cronbach's alpha = 0.95
# wave 2
resp_df_w2 <- dat_w2[, names(dat_w2) %in% resp_items]
assign(x = "resp_scale", value = rowMeans(resp_df_w2, na.rm = T))
dat_w2["resp"] <- resp_scale
# wave 3
resp_df_w3 <- dat_w3[, names(dat_w3) %in% resp_items]
assign(x = "resp_scale", value = rowMeans(resp_df_w3, na.rm = T))
dat_w3["resp"] <- resp_scale

# Trust ------------------------------------------------------------------------
# wave 1
trust_items <- trust$var_new
trust_df <- dat_w1[, names(dat_w1) %in% trust_items]
assign(x = "trust_scale", value = rowMeans(trust_df, na.rm = T))
dat_w1["trust"] <- trust_scale

# output alphas
cat(paste("Trust Cronbach's alpha =", 
          round(psych::alpha(trust_df)$total["raw_alpha"], 2)))
## Trust Cronbach's alpha = 0.87
# wave 2
trust_df_w2 <- dat_w2[, names(dat_w2) %in% trust_items]
assign(x = "trust_scale", value = rowMeans(trust_df_w2, na.rm = T))
dat_w2["trust"] <- trust_scale
# wave 3
trust_df_w3 <- dat_w3[, names(dat_w3) %in% trust_items]
assign(x = "trust_scale", value = rowMeans(trust_df_w3, na.rm = T))
dat_w3["trust"] <- trust_scale

# PRQC -------------------------------------------------------------------------
# general quality
prqc_df <- dat_w1[, names(dat_w1) %in% prqc$var_new]
assign(x = "prqc_overall", value = rowMeans(prqc_df, na.rm = T))
dat_w1["prqc_overall"] <- get("prqc_overall")

# output alphas
cat(paste("PRQC Overall Cronbach's alpha =", 
          round(psych::alpha(prqc_df)$total["raw_alpha"], 2)))
## PRQC Overall Cronbach's alpha = 0.88
prqc_df_w2 <- dat_w2[, names(dat_w2) %in% prqc$var_new]
assign(x = "prqc_overall_w2", value = rowMeans(prqc_df_w2, na.rm = T))
dat_w2["prqc_overall"] <- get("prqc_overall_w2")
prqc_df_w3 <- dat_w3[, names(dat_w3) %in% prqc$var_new]
assign(x = "prqc_overall_w3", value = rowMeans(prqc_df_w3, na.rm = T))
dat_w3["prqc_overall"] <- get("prqc_overall_w3")

To conform to the data structure required for the analytic scripts, the data will be combined into a long dataframe across 3 waves, with time denoting the timepoint, then transformed to a wider structure, with each row representing a couple at a specific time point, instead of a participant at a specific time point as the data structure shown here in this descriptive report. The suffix _1 denotes a female participant, and _2 denotes a male participant.

# select only demographics and scale scores
dat_w1 <- dat_w1 %>%
  select(all_of(c(basics$var_new, 
                  paste0(bfas_self$subscale, "_self"),
                  paste0(bfas_partner$subscale, "_partner"),
                  aaq$subscale, "resp", "trust", "prqc_overall")))
dat_w2 <- dat_w2 %>%
select(all_of(c(basics$var_new[1], 
                paste0(bfas_self$subscale, "_self"),
                paste0(bfas_partner$subscale, "_partner"),
                aaq$subscale, "resp", "trust", "prqc_overall")))
dat_w3 <- dat_w3 %>%
select(all_of(c(basics$var_new[1], 
                paste0(bfas_self$subscale, "_self"),
                paste0(bfas_partner$subscale, "_partner"),
                aaq$subscale, "resp", "trust", "prqc_overall")))

# fix missing sex
dat_w1[dat_w1$ID == "9nbmand4",]$sex <- 2
dat_w1[dat_w1$ID == "kkm56fww",]$sex <- 1

# merge in demographics
dat_w2 <- merge(dat_w1[c(basics$var_new)], dat_w2, all.y = T)
dat_w3 <- merge(dat_w1[c(basics$var_new)], dat_w3, all.y = T)

# merge in couple IDs
dat_w1 <- merge(ids, dat_w1, all.y = T)
dat_w2 <- merge(ids, dat_w2, all.y = T)
dat_w3 <- merge(ids, dat_w3, all.y = T)

# only keep data when both partners are present
full_ids <- na.omit(dat_w1$couple[duplicated(dat_w1$couple)])
dat_w1 <- dat_w1 %>%
  filter(couple %in% full_ids)
full_ids_w2 <- na.omit(dat_w2$couple[duplicated(dat_w2$couple)])
dat_w2 <- dat_w2 %>%
  filter(couple %in% full_ids_w2)
full_ids_w3 <- na.omit(dat_w3$couple[duplicated(dat_w3$couple)])
dat_w3 <- dat_w3 %>%
  filter(couple %in% full_ids_w3)

# add time variable
dat_w1 <- dat_w1 %>%
  mutate(time = 0) %>%
  relocate(time) %>%
  # filter out same-gender couples
  filter(!couple %in% c(4968, 4991, 5000, 5013, 5068, 5112))
dat_w2 <- dat_w2 %>%
  mutate(time = 8) %>%
  relocate(time) %>%
  # filter out same-gender couples
  filter(!couple %in% c(4968, 4991, 5000, 5013, 5068, 5112))
dat_w3 <- dat_w3 %>%
  mutate(time = 16) %>%
  relocate(time) %>%
  # filter out same-gender couples
  filter(!couple %in% c(4968, 4991, 5000, 5013, 5068, 5112))

# long datasets of all time points
dat_long <- rbind(dat_w1, dat_w2, dat_w3) %>% select(-ID)

# fix couple IDs to range from 0 to 1
id_df <- data.frame(
  id_old = sort(unique(dat_w1$couple)),
  id_new = 1:length(unique(dat_w1$couple))
)
for(id in 1:nrow(id_df)) {
  dat_long$couple[dat_long$couple == id_df$id_old[id]] <- id_df$id_new[id]
}

# pivot_wider for 1 couple at 1 time per row
dat_analytic <- dat_long %>%
  select(-c(`Participant Number`)) %>%
  pivot_wider(id_cols = c("couple", "time"),
              names_from = "sex",
              values_from = names(dat_long)
              [!names(dat_long) %in% c("couple", "sex", "time", "Participant Number")])

# save data file
#rio::export(dat_analytic, 
#            paste0(here(), "/data/cleaned_data_yw.RDS"))

1. Demographics and Scale Scores

# demographics
dat_w1 %>%
  select("age", "duration", "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other") %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of demographic variables") %>%
  kable_styling()
Descriptives of demographic variables
age duration ethnic_black ethnic_asian ethnic_white ethnic_hisp ethnic_other
Mean 21.30 11.6 0.022 0.117 0.791 0.030 0.068
Std.Dev 4.33 22.4 0.146 0.322 0.407 0.171 0.252
Min 18.00 1.0 0.000 0.000 0.000 0.000 0.000
Median 20.00 8.0 0.000 0.000 1.000 0.000 0.000
Max 58.00 300.0 1.000 1.000 1.000 1.000 1.000
N.Valid 366.00 362.0 368.000 368.000 368.000 368.000 368.000
Pct.Valid 99.46 98.4 100.000 100.000 100.000 100.000 100.000
dat_w1 %>%
  filter(sex == 1) %>%
  select("age", "duration", "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other") %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of demographic variables for female participants") %>%
  kable_styling()
Descriptives of demographic variables for female participants
age duration ethnic_black ethnic_asian ethnic_white ethnic_hisp ethnic_other
Mean 20.72 11.5 0.016 0.147 0.783 0.016 0.076
Std.Dev 3.99 19.7 0.127 0.355 0.414 0.127 0.266
Min 18.00 1.0 0.000 0.000 0.000 0.000 0.000
Median 20.00 8.0 0.000 0.000 1.000 0.000 0.000
Max 57.00 200.0 1.000 1.000 1.000 1.000 1.000
N.Valid 183.00 182.0 184.000 184.000 184.000 184.000 184.000
Pct.Valid 99.46 98.9 100.000 100.000 100.000 100.000 100.000
dat_w1 %>%
  filter(sex == 2) %>%
  select("age", "duration", "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other") %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of demographic variables for male participants") %>%
  kable_styling()
Descriptives of demographic variables for male participants
age duration ethnic_black ethnic_asian ethnic_white ethnic_hisp ethnic_other
Mean 21.88 11.7 0.027 0.087 0.799 0.043 0.060
Std.Dev 4.59 24.8 0.163 0.283 0.402 0.204 0.238
Min 18.00 2.0 0.000 0.000 0.000 0.000 0.000
Median 21.00 8.0 0.000 0.000 1.000 0.000 0.000
Max 58.00 300.0 1.000 1.000 1.000 1.000 1.000
N.Valid 183.00 180.0 184.000 184.000 184.000 184.000 184.000
Pct.Valid 99.46 97.8 100.000 100.000 100.000 100.000 100.000
# scale scores wave 1
dat_w1 %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 1") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 1
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.672 3.875 3.371 3.657 3.726 2.678 3.799 3.411 3.612 3.674 3.27 3.231 7.41 5.218 6.222
Std.Dev 0.646 0.474 0.551 0.594 0.527 0.768 0.641 0.667 0.606 0.649 1.06 0.984 1.15 0.822 0.761
Min 1.100 2.500 1.850 1.600 2.200 1.000 1.875 1.500 1.625 1.750 1.00 1.000 3.11 2.471 2.333
Median 2.650 3.900 3.400 3.700 3.700 2.625 3.875 3.500 3.625 3.625 3.12 3.222 7.67 5.294 6.333
Max 4.650 4.850 4.800 4.850 4.900 5.000 5.000 4.875 5.000 5.000 6.25 6.333 9.00 6.824 7.000
N.Valid 363.000 363.000 363.000 363.000 363.000 357.000 357.000 357.000 357.000 357.000 358.00 358.000 358.00 355.000 357.000
Pct.Valid 98.641 98.641 98.641 98.641 98.641 97.011 97.011 97.011 97.011 97.011 97.28 97.283 97.28 96.467 97.011
dat_w1 %>%
  filter(sex == 1) %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 1 for female participants") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 1 for female participants
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.900 3.976 3.421 3.671 3.694 2.503 3.79 3.280 3.657 3.627 3.30 3.33 7.47 5.256 6.231
Std.Dev 0.617 0.448 0.583 0.608 0.533 0.761 0.67 0.717 0.633 0.685 1.02 1.05 1.20 0.851 0.774
Min 1.600 2.700 1.950 1.600 2.200 1.000 1.88 1.500 1.875 1.750 1.25 1.22 3.11 2.471 2.333
Median 2.900 4.050 3.450 3.750 3.700 2.375 3.88 3.375 3.750 3.625 3.19 3.22 7.72 5.235 6.333
Max 4.650 4.850 4.800 4.800 4.900 4.625 5.00 4.875 5.000 5.000 5.88 6.33 9.00 6.824 7.000
N.Valid 183.000 183.000 183.000 183.000 183.000 182.000 182.00 182.000 182.000 182.000 182.00 182.00 182.00 182.000 182.000
Pct.Valid 99.457 99.457 99.457 99.457 99.457 98.913 98.91 98.913 98.913 98.913 98.91 98.91 98.91 98.913 98.913
dat_w1 %>%
  filter(sex == 2) %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 1 for male participants") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 1 for male participants
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.44 3.771 3.320 3.64 3.76 2.859 3.811 3.549 3.565 3.723 3.23 3.131 7.35 5.178 6.212
Std.Dev 0.59 0.478 0.513 0.58 0.52 0.734 0.612 0.581 0.574 0.609 1.11 0.897 1.09 0.792 0.749
Min 1.10 2.500 1.850 2.05 2.55 1.250 1.875 2.000 1.625 2.125 1.00 1.000 3.72 3.118 3.667
Median 2.40 3.850 3.275 3.70 3.73 2.875 3.875 3.500 3.625 3.625 3.00 3.111 7.53 5.294 6.333
Max 4.20 4.850 4.650 4.85 4.85 5.000 5.000 4.875 4.750 5.000 6.25 6.333 9.00 6.706 7.000
N.Valid 180.00 180.000 180.000 180.00 180.00 175.000 175.000 175.000 175.000 175.000 176.00 176.000 176.00 173.000 175.000
Pct.Valid 97.83 97.826 97.826 97.83 97.83 95.109 95.109 95.109 95.109 95.109 95.65 95.652 95.65 94.022 95.109
# scale scores wave 2
dat_w2 %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 2") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 2
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.719 3.784 3.383 3.542 3.556 2.676 3.75 3.358 3.518 3.623 3.186 3.16 7.30 5.259 6.122
Std.Dev 0.743 0.552 0.522 0.577 0.651 0.799 0.68 0.624 0.583 0.653 0.985 1.06 1.18 0.872 0.932
Min 1.000 1.875 1.750 2.000 1.750 1.000 1.62 1.500 2.250 1.625 1.000 1.11 2.94 2.000 2.333
Median 2.625 3.750 3.375 3.625 3.500 2.625 3.75 3.375 3.500 3.625 3.125 3.00 7.50 5.353 6.333
Max 4.625 5.000 4.500 5.000 4.875 4.875 5.00 5.000 4.875 5.000 5.375 6.33 9.00 6.941 7.000
N.Valid 235.000 235.000 235.000 235.000 235.000 231.000 231.00 231.000 231.000 231.000 231.000 231.00 234.00 230.000 231.000
Pct.Valid 99.576 99.576 99.576 99.576 99.576 97.881 97.88 97.881 97.881 97.881 97.881 97.88 99.15 97.458 97.881
dat_w2 %>%
  filter(sex == 1) %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 2 for female participants") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 2 for female participants
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.913 3.815 3.426 3.548 3.593 2.453 3.722 3.292 3.51 3.598 3.246 3.25 7.35 5.285 6.155
Std.Dev 0.736 0.547 0.572 0.597 0.677 0.715 0.693 0.669 0.61 0.748 0.997 1.13 1.15 0.902 0.956
Min 1.125 1.875 1.750 2.000 1.875 1.000 1.625 2.000 2.25 1.625 1.000 1.11 3.56 2.294 2.667
Median 2.875 3.875 3.500 3.625 3.500 2.375 3.750 3.250 3.50 3.625 3.125 3.11 7.47 5.412 6.500
Max 4.625 4.875 4.500 4.875 4.875 4.250 5.000 5.000 4.62 5.000 5.375 6.33 9.00 6.941 7.000
N.Valid 118.000 118.000 118.000 118.000 118.000 116.000 116.000 116.000 116.00 116.000 116.000 116.00 118.00 116.000 116.000
Pct.Valid 100.000 100.000 100.000 100.000 100.000 98.305 98.305 98.305 98.31 98.305 98.305 98.31 100.00 98.305 98.305
dat_w2 %>%
  filter(sex == 2) %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 2 for male participants") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 2 for male participants
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.524 3.753 3.340 3.536 3.518 2.901 3.776 3.424 3.523 3.648 3.125 3.065 7.25 5.233 6.09
Std.Dev 0.701 0.557 0.465 0.558 0.625 0.818 0.669 0.569 0.556 0.542 0.974 0.981 1.22 0.844 0.91
Min 1.000 2.500 2.000 2.000 1.750 1.125 1.750 1.500 2.250 2.375 1.250 1.333 2.94 2.000 2.33
Median 2.500 3.750 3.375 3.500 3.500 2.875 3.750 3.375 3.625 3.625 3.125 3.000 7.50 5.294 6.17
Max 4.250 5.000 4.375 5.000 4.875 4.875 5.000 4.875 4.875 4.875 5.250 5.778 9.00 6.647 7.00
N.Valid 117.000 117.000 117.000 117.000 117.000 115.000 115.000 115.000 115.000 115.000 115.000 115.000 116.00 114.000 115.00
Pct.Valid 99.153 99.153 99.153 99.153 99.153 97.458 97.458 97.458 97.458 97.458 97.458 97.458 98.31 96.610 97.46
# scale scores wave 3
dat_w3 %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 3") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 3
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.605 3.845 3.418 3.604 3.623 2.609 3.778 3.369 3.558 3.67 3.23 3.13 7.43 5.276 6.12
Std.Dev 0.746 0.522 0.537 0.516 0.659 0.805 0.768 0.712 0.614 0.71 1.06 1.08 1.40 0.982 1.04
Min 1.000 2.500 1.875 2.125 2.000 1.125 1.000 1.250 2.000 2.00 1.12 1.00 1.00 1.353 1.00
Median 2.625 3.875 3.500 3.625 3.625 2.625 3.875 3.375 3.625 3.62 3.25 3.00 7.78 5.471 6.50
Max 4.375 5.000 4.625 4.750 5.000 5.000 5.000 5.000 5.125 5.00 5.75 5.78 9.00 7.000 7.00
N.Valid 132.000 132.000 132.000 132.000 132.000 130.000 130.000 130.000 130.000 130.00 131.00 131.00 132.00 130.000 130.00
Pct.Valid 98.507 98.507 98.507 98.507 98.507 97.015 97.015 97.015 97.015 97.02 97.76 97.76 98.51 97.015 97.02
dat_w3 %>%
  filter(sex == 1) %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 3 for female participants") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 3 for female participants
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.808 3.920 3.506 3.677 3.660 2.38 3.775 3.271 3.583 3.722 3.11 3.12 7.52 5.359 6.184
Std.Dev 0.758 0.432 0.535 0.543 0.684 0.78 0.724 0.724 0.671 0.712 1.08 1.12 1.27 0.919 0.874
Min 1.500 3.125 2.250 2.250 2.250 1.12 2.250 1.250 2.125 2.000 1.12 1.00 2.78 2.941 3.000
Median 2.875 3.875 3.500 3.750 3.750 2.25 3.875 3.250 3.625 3.625 2.88 2.89 7.89 5.500 6.500
Max 4.375 5.000 4.625 4.750 4.875 4.38 5.000 4.875 4.875 5.000 5.38 5.67 9.00 7.000 7.000
N.Valid 67.000 67.000 67.000 67.000 67.000 66.00 66.000 66.000 66.000 66.000 66.00 66.00 67.00 66.000 66.000
Pct.Valid 100.000 100.000 100.000 100.000 100.000 98.51 98.507 98.507 98.507 98.507 98.51 98.51 100.00 98.507 98.507
dat_w3 %>%
  filter(sex == 2) %>%
  select(-c("sex", "age", "time", "rela_status", "duration",
            "couple", "Participant Number",
            "ethnic_black", "ethnic_asian", "ethnic_white", "ethnic_hisp", "ethnic_other")) %>%
  descr(stats = "common", order = "p") %>%
  knitr::kable(caption = "Descriptives of scale scores at wave 3 for male participants") %>%
  kable_styling() %>%
  scroll_box(height = "300px")
Descriptives of scale scores at wave 3 for male participants
neuroticism_self agreeableness_self conscientiousness_self extraversion_self openness_self neuroticism_partner agreeableness_partner conscientiousness_partner extraversion_partner openness_partner avoidance anxiety resp trust prqc_overall
Mean 2.396 3.767 3.327 3.53 3.585 2.846 3.781 3.47 3.531 3.611 3.36 3.14 7.33 5.19 6.05
Std.Dev 0.678 0.595 0.527 0.48 0.636 0.765 0.816 0.69 0.554 0.709 1.03 1.05 1.52 1.04 1.18
Min 1.000 2.500 1.875 2.12 2.000 1.250 1.000 1.88 2.000 2.000 1.38 1.00 1.00 1.35 1.00
Median 2.375 3.750 3.250 3.50 3.625 2.875 4.000 3.50 3.562 3.562 3.50 3.00 7.67 5.38 6.50
Max 3.750 4.875 4.375 4.50 5.000 5.000 5.000 5.00 5.125 5.000 5.75 5.78 9.00 6.88 7.00
N.Valid 65.000 65.000 65.000 65.00 65.000 64.000 64.000 64.00 64.000 64.000 65.00 65.00 65.00 64.00 64.00
Pct.Valid 97.015 97.015 97.015 97.02 97.015 95.522 95.522 95.52 95.522 95.522 97.02 97.02 97.02 95.52 95.52

There are a total of 184 couples at time 1, 118 at time 2, and 67 at time 3.

2. Plots and Gender Comparison

Age

p <- plot_hist(var = "age", var_name = "Age", 
               data = dat_w1, bin_width = 1,
               var_sex = "sex", female_male = c("1", "2"))
if(signif(var = "age",
          var_sex = "sex",
          data = dat_w1,
          female_male = c("1", "2"))) {
  p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
  }

print(p)

Big Five Traits

Self-Reports

for(ivar in c("Agreeableness", "Conscientiousness", "Extraversion",
              "Neuroticism", "Openness")){
  p <- plot_hist(var = paste0(tolower(ivar), "_self"), 
                 var_name = paste("BFAS", ivar, "- Self-Reports"), 
                 data = dat_w1, bin_width = 0.2,
                 var_sex = "sex", female_male = c("1", "2")) +
    xlim(1,5)

  if(signif(var = paste0(tolower(ivar), "_self"),
            var_sex = "sex",
            data = dat_w1,
            female_male = c("1", "2"))) {
    p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
  }
  print(p)
}

Partner-Reports

for(ivar in c("Agreeableness", "Conscientiousness", "Extraversion",
              "Neuroticism", "Openness")){
  p <- plot_hist(var = paste0(tolower(ivar), "_partner"), 
                 var_name = paste("BFAS", ivar, "- Partner-Reports"), 
                 data = dat_w1, bin_width = 0.2,
                 var_sex = "sex", female_male = c("1", "2")) +
    xlim(1,5)

  if(signif(var = paste0(tolower(ivar), "_partner"),
            var_sex = "sex",
            data = dat_w1,
            female_male = c("1", "2"))) {
    p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
  }
  print(p)
}

Adult Attachment Questionnaire

for(ivar in c("Avoidance", "Anxiety")){
  p <- plot_hist(var = tolower(ivar), 
                 var_name = paste("Adult Attachment Questionnaire -", ivar), 
                 data = dat_w1, bin_width = 0.2,
                 var_sex = "sex", female_male = c("1", "2")) +
    xlim(1,7)

  if(signif(var = tolower(ivar),
            var_sex = "sex",
            data = dat_w1,
            female_male = c("1", "2"))) {
    p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
  }
  print(p)
}

Responsiveness Scale

p <- plot_hist(var = "resp", 
               var_name = paste("Responsiveness Score"), 
               data = dat_w1, bin_width = 0.2,
               var_sex = "sex", female_male = c("1", "2")) +
  xlim(1,9)

if(signif(var = "resp",
          var_sex = "sex",
          data = dat_w1,
          female_male = c("1", "2"))) {
  p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
}
print(p)

Trust Scale

p <- plot_hist(var = "trust", 
               var_name = paste("Trust Score"), 
               data = dat_w1, bin_width = 0.2,
               var_sex = "sex", female_male = c("1", "2")) +
  xlim(1,7)

if(signif(var = "trust",
          var_sex = "sex",
          data = dat_w1,
          female_male = c("1", "2"))) {
  p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
}
print(p)

Perceived Relationship Quality Component Scale

p <- plot_hist(var = "prqc_overall", 
               var_name = paste("PRQC Relationship Quality Overall Score"), 
               data = dat_w1, bin_width = 0.5,
               var_sex = "sex", female_male = c("1", "2")) +
  xlim(1,7)

if(signif(var = "prqc_overall",
          var_sex = "sex",
          data = dat_w1,
          female_male = c("1", "2"))) {
  p <- p + labs(subtitle = "Significant sex difference (p < 0.05)")
}
print(p)

3. Test-retest reliabilities

# create list of all variables
base_vars <- c(
  # traits
  paste0(c("neuroticism", "agreeableness", "conscientiousness", "extraversion", "openness"), "_self"),
  # CA
  "avoidance", "anxiety", "resp", "trust",
  # relationship quality
  "prqc_overall"
)
var_list <- rep(
  paste0(rep(base_vars, each = 2), c("_1", "_2")), 
  each = 1
)

# calculate ICC for all longitudinal variables
ICC_df <- data.frame(matrix(ncol=9,nrow=0))
names(ICC_df) <- c("variable", "type", "ICC", "F", "df1", "df2", 
                   "p", "lower bound", "upper bound")
for(var in var_list){
  # find ICC
  result <- icc_function(ID = "couple", var = var, time_var = "time",
                         df = dat_analytic) %>% as.data.frame()
  result <- cbind(variable = var, result)

  # append to df
  ICC_df <- rbind(ICC_df, result)
}
rownames(ICC_df) <- NULL

# print
ICC_df %>%
  knitr::kable(caption = "Test-retest reliabilities") %>%
  kableExtra::kable_styling() %>%
  scroll_box(height = "300px")
Test-retest reliabilities
variable type ICC F df1 df2 p lower bound upper bound
neuroticism_self_1 ICC1k 0.804 5.09 183 368 0 0.749 0.848
neuroticism_self_2 ICC1k 0.824 5.67 183 368 0 0.774 0.864
agreeableness_self_1 ICC1k 0.753 4.05 183 368 0 0.685 0.809
agreeableness_self_2 ICC1k 0.850 6.68 183 368 0 0.809 0.884
conscientiousness_self_1 ICC1k 0.879 8.27 183 368 0 0.845 0.907
conscientiousness_self_2 ICC1k 0.842 6.31 183 368 0 0.797 0.877
extraversion_self_1 ICC1k 0.805 5.12 183 368 0 0.750 0.849
extraversion_self_2 ICC1k 0.863 7.30 183 368 0 0.825 0.894
openness_self_1 ICC1k 0.876 8.04 183 368 0 0.841 0.904
openness_self_2 ICC1k 0.843 6.37 183 368 0 0.799 0.879
avoidance_1 ICC1k 0.871 7.73 183 368 0 0.835 0.900
avoidance_2 ICC1k 0.900 10.03 183 368 0 0.872 0.923
anxiety_1 ICC1k 0.862 7.27 183 368 0 0.824 0.894
anxiety_2 ICC1k 0.854 6.84 183 368 0 0.813 0.887
resp_1 ICC1k 0.861 7.21 183 368 0 0.823 0.893
resp_2 ICC1k 0.880 8.34 183 368 0 0.847 0.907
trust_1 ICC1k 0.879 8.25 183 368 0 0.845 0.906
trust_2 ICC1k 0.858 7.03 183 368 0 0.818 0.890
prqc_overall_1 ICC1k 0.850 6.67 183 368 0 0.808 0.884
prqc_overall_2 ICC1k 0.851 6.71 183 368 0 0.809 0.885