Hypothesis 2:

A zero-sum mindset is relatively stable over time. ## Loading Libraries

library(readr)
library(here)
library(tidyverse)
library(psych)
library(BlandAltmanLeh)
library(irr)
library(pander)

Loading Longitudinal Datasets

s1 <- read_csv(here("OSF", "data", "clean", "minimal", "s1b.csv"))
s2 <- read_csv(here("OSF", "data", "clean", "minimal", "s2.csv"))
s3b <- read_csv(here("OSF", "data", "clean", "minimal", "s3b.csv"))
s4 <- read_csv(here("OSF", "data", "clean", "minimal", "s4.csv"))
s5 <- read_csv(here("OSF", "data", "clean", "minimal", "s5.csv"))

Analysis

library(irr)

# Create a list to store the ICC results
icc_results <- list()

# Loop through the datasets
datasets <- c("s1", "s2", "s3b", "s4", "s5")
for (dataset in datasets) {
  # Combine the ratings into a data frame
  ratings <- data.frame(T1 = eval(parse(text = paste0(dataset, "$zsm_mean_T1"))),
                        T2 = eval(parse(text = paste0(dataset, "$zsm_mean_T2"))))
  
  # Compute the ICC using icc() function from irr package
  icc_result <- icc(ratings, model = "twoway", type = "agreement", unit = "average", r0 = 7, conf.level = 0.95)
  
  # Store the ICC result in the list
  icc_results[[dataset]] <- icc_result
}

# Create a data frame to store the summary results
summary_df <- data.frame(
  Sample = datasets,
  ICC = sapply(icc_results, function(x) x$value),
  Lower_CI = sapply(icc_results, function(x) x$lbound),
  Upper_CI = sapply(icc_results, function(x) x$ubound)
)

# Print the summary table
print(summary_df)
##     Sample       ICC  Lower_CI  Upper_CI
## s1      s1 0.8193921 0.7772542 0.8535464
## s2      s2 0.7753126 0.7215934 0.8186610
## s3b    s3b 0.7806074 0.7205452 0.8277532
## s4      s4 0.8158118 0.7763534 0.8482515
## s5      s5 0.8342496 0.7854481 0.8719486
pander(summary_df)
  Sample ICC Lower_CI Upper_CI
s1 s1 0.8194 0.7773 0.8535
s2 s2 0.7753 0.7216 0.8187
s3b s3b 0.7806 0.7205 0.8278
s4 s4 0.8158 0.7764 0.8483
s5 s5 0.8342 0.7854 0.8719