#=====================================================# # L-EFT Co 2015 Task Analysis: Accuracy Data # # CO November 2015 - March 2016 L-EFT 2.0 # # RELATIONSHIP LEFT 2.0 & GEFT & EF's # # DATE: 09/10/2017 - Hanne Huygelier # #=====================================================# #================== # LIBRARIES #================== library(ggplot2) library(psych) library(gridExtra) library(tidyr) library(lme4) library(lmerTest) #================== # FOLDERS #================== DataFolder = "C://Users//u0097836//Documents//EFT_Project//Data Manuscript 2//Study 3//Summaries//" setwd(DataFolder) #================== # DATA #================== load(paste(DataFolder, "CORSI.Rdata", sep = "")) load(paste(DataFolder, "EFTs_CO2.Rdata", sep = "")) load(paste(DataFolder, "RAVEN.Rdata", sep = "")) # CHANGE COLUMN NAMES: colnames(EFT)[1] <- "participant" colnames(SumScore)[2:3] <- c("RavenScore", "RavenRT") # Raven --> proportion correct: SumScore$RavenScore <- SumScore$RavenScore / 12 # MAKE LONG DATAFORMAT: EFTLong <- gather(data = EFT, key = EFTVersion, value = Accuracy, GroupEFT:LEFT, factor_key = TRUE) # MERGE DATAFRAMES WITH WIDE FORMAT: Summary <- merge(Span, EFT, by = "participant") Summary <- merge(Summary, SumScore, by = "participant") # MERGE DATAFRAMES WITH LONG FORMAT: Summary2 <- merge(Span, EFTLong, by = "participant") Summary2 <- merge(Summary2, SumScore, by = "participant") # CLEAN UP: remove(Span, SumScore, EFT) #===================== # PLOT DATA #===================== # GGPLOT SETTINGS: theme_set(theme_classic(base_size = 35)) # INTERACTION OF EFT's and WORKING MEMORY: pl <- ggplot(data = Summary2, aes(x = PCL, y = Accuracy, col = EFTVersion)) pl <- pl + geom_line(aes(group = participant), col = "black", linetype = "dashed", alpha = 0.25) pl <- pl + geom_point(size = 2) pl <- pl + geom_smooth(se = T, method = "lm", formula = y ~ x) pl <- pl + theme(legend.position = "bottom") pl <- pl + scale_y_continuous(breaks = seq(0, 1, 0.25), limits = c(0, 1)) pl <- pl + scale_x_continuous(breaks = seq(3, 7, 1), limits = c(3, 7)) pl <- pl + labs(x = "Memory span", colour = "EFT Version: ") pl <- pl + scale_color_manual(values = c("#3399ff", "#00cc00"), breaks = c("GroupEFT", "LEFT"), labels = c("G-EFT", "L-EFT")) pl # INTERACTION OF EFT's and IQ: pl1 <- ggplot(data = Summary2, aes(x = RavenScore, y = Accuracy, col = EFTVersion)) pl1 <- pl1 + geom_line(aes(group = participant), col = "black", linetype = "dashed", alpha = 0.25) pl1 <- pl1 + geom_point(size = 2) pl1 <- pl1 + geom_smooth(se = T, method = "lm", formula = y ~ x) pl1 <- pl1 + theme(legend.position = "bottom") pl1 <- pl1 + scale_y_continuous(breaks = seq(0, 1, 0.25), limits = c(0, 1)) pl1 <- pl1 + scale_x_continuous(breaks = seq(0, 1, 0.25), limits = c(0, 1)) pl1 <- pl1 + labs(x = "RAPM Accuracy", colour = "EFT Version: ") pl1 <- pl1 + scale_color_manual(values = c("#3399ff", "#00cc00"), breaks = c("GroupEFT", "LEFT"), labels = c("G-EFT", "L-EFT")) pl1 grid.arrange(pl, pl1, ncol = 2) Plot <- arrangeGrob(pl, pl1, ncol = 2) ggsave(Plot, file = "C:/Users/u0097836/Documents/EFT_Project/Write_Ups/LEFT_Paper2/Manuscript_TBD/Study3.png", dpi = 600, width = 16, height = 8) #===================== # REGRESSION ANALYSIS #===================== M1 <- lmer(Accuracy ~ PCL + RavenScore + EFTVersion * PCL + RavenScore * EFTVersion + (1|participant), data = Summary2) summary(M1)