11# This script will run stats on mfe_c data.
22# Author: Kianoosh Hosseini at NDCLab @FIU (https://Kianoosh.info; https://NDClab.com)
3- # Last Update: 2025-01-21 (YYYY-MM-DD)
3+ # Last Update: 2025-10-16 (YYYY-MM-DD)
44
55library(tidyverse )
66library(dplyr )
@@ -18,15 +18,15 @@ library(effectsize)
1818
1919# Loading mfe_c_face data
2020
21- proje_wd <- " /Users/kihossei/Library/CloudStorage/[email protected] /My Drive/My Digital Life/Professional/ Github_Repos/mfe-c-dataset" 21+ proje_wd <- " /Github_Repos/mfe-c-dataset"
2222setwd(proje_wd )
2323
2424processed_file_input <- paste(proje_wd , " derivatives" , " psychopy" , " stat_output" , " mfe-c-face" , sep = " /" , collapse = NULL ) # input data directory
2525
2626face_df <- read.csv(file = paste(processed_file_input , " processed_data_mfe_c_face_Proj_v1.csv" , sep = " /" , collapse = NULL ), stringsAsFactors = FALSE , na.strings = c(" " , " NA" ))
2727
2828# Keep the columns that we will need
29- selected_columns <- face_df [, c(" participant_id" , " flankEff_meanACC" , " congAcc" , " incongAcc" , " congCorr_meanRT" , " incongCorr_meanRT" , " committed_errors" , " error_proRec" , " correct_proRec" , " overall_proRec" , " proRec_error_minus_correct" , " scaared_b_scrdSoc_s1_r1_e1" , " scaared_b_scrdGA_s1_r1_e1 " , " scaared_b_scrdTotal_s1_r1_e1 " , " bfne_b_scrdTotal_s1_r1_e1 " , " epepq15_scrdTotal_s1_r1_e1 " , " phq8_scrdTotal_s1_r1_e1 " )]
29+ selected_columns <- face_df [, c(" participant_id" , " flankEff_meanACC" , " congAcc" , " incongAcc" , " congCorr_meanRT" , " incongCorr_meanRT" , " committed_errors" , " error_proRec" , " correct_proRec" , " overall_proRec" , " proRec_error_minus_correct" , " scaared_b_scrdSoc_s1_r1_e1" )]
3030face_df <- selected_columns
3131
3232# Check the values in every column in main_df and remove the outliers based on +- 3SD.
@@ -56,7 +56,7 @@ processed_file_input <- paste(proje_wd, "derivatives", "psychopy", "stat_output"
5656
5757object_df <- read.csv(file = paste(processed_file_input , " processed_data_mfe_c_object_Proj_v1.csv" , sep = " /" , collapse = NULL ), stringsAsFactors = FALSE , na.strings = c(" " , " NA" ))
5858# Keep the columns that we will need
59- selected_columns <- object_df [, c(" participant_id" , " flankEff_meanACC" , " congAcc" , " incongAcc" , " congCorr_meanRT" , " incongCorr_meanRT" , " committed_errors" , " error_proRec" , " correct_proRec" , " overall_proRec" , " proRec_error_minus_correct" , " scaared_b_scrdSoc_s1_r1_e1" , " scaared_b_scrdGA_s1_r1_e1 " , " scaared_b_scrdTotal_s1_r1_e1 " , " bfne_b_scrdTotal_s1_r1_e1 " , " epepq15_scrdTotal_s1_r1_e1 " , " phq8_scrdTotal_s1_r1_e1 " )]
59+ selected_columns <- object_df [, c(" participant_id" , " flankEff_meanACC" , " congAcc" , " incongAcc" , " congCorr_meanRT" , " incongCorr_meanRT" , " committed_errors" , " error_proRec" , " correct_proRec" , " overall_proRec" , " proRec_error_minus_correct" , " scaared_b_scrdSoc_s1_r1_e1" )]
6060object_df <- selected_columns
6161
6262# apply this outlier removing function to all the columns in the dataframe except for participant ID column.
@@ -69,8 +69,17 @@ object_df$group <- 'object' # adding a column that specifies the group (will be
6969# binding these two dataframes two create a single main_df
7070main_df <- rbind(face_df , object_df )
7171
72+ # Save the data
73+ # write the extracted and computed summary scores to disk
74+ temp_dir1 <- " /Github_Repos/mfe-c-dataset/derivatives/psychopy/stat_output"
75+ write.csv(main_df , paste(temp_dir1 , " mfe_c_final_data.csv" , sep = " /" , collapse = NULL ), row.names = FALSE )
76+ # ########
7277
7378
79+ # #### To replicate, this final data is available on github repository (see the directory above within the mfe-c-dataset repo).
80+ # #### Load this final data here and then you can run the stats below.
81+ main_df <- read.csv(file = paste(" /Github_Repos/mfe-c-dataset/derivatives/psychopy/stat_output/mfe_c_final_data.csv" , sep = " /" , collapse = NULL ), stringsAsFactors = FALSE , na.strings = c(" " , " NA" ))
82+
7483# ##################################### accuracy ~ congruency*group MODEL #############################################
7584# Reshape to Long Format
7685long_main_df1 <- main_df %> %
0 commit comments