Skip to content

Commit 701987a

Browse files
data_upload1
1 parent ef903a3 commit 701987a

File tree

6 files changed

+28
-19
lines changed

6 files changed

+28
-19
lines changed

code/stats/mfe_c_face_and_object_stats.R

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

55
library(tidyverse)
66
library(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"
2222
setwd(proje_wd)
2323

2424
processed_file_input <- paste(proje_wd, "derivatives", "psychopy", "stat_output", "mfe-c-face", sep ="/", collapse = NULL) # input data directory
2525

2626
face_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")]
3030
face_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

5757
object_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")]
6060
object_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
7070
main_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
7685
long_main_df1 <- main_df %>%

code/stats/mfe_c_face_data_organizer.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# This script will load, and organize the Psychopy data for the mfe_c_face study.
1+
# This script will load, and organize the Psychopy data for the mfe_c_face.
22
# For each participant, a single, new, organized csv file that has all the necessary information will be generated.
33
# Author: Kianoosh Hosseini at NDCLab @FIU (https://Kianoosh.info; https://NDClab.com)
4-
# Last Update: 2024-08-14 (YYYY-MM-DD)
4+
# Last Update: 2025-10-16 (YYYY-MM-DD)
55

66
library(tidyverse)
77
library(dplyr)
88
library(stringr)
99

1010
#Working directory should be the Psychopy experiment directory.
11-
proje_wd <- "/GitHub_Repos/mfe-c-dataset"
11+
proje_wd <- "/Github_Repos/mfe-c-dataset"
1212
setwd(proje_wd)
1313

1414
# Defining the input and output folders.

code/stats/mfe_c_face_measure_computations.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# This script will load, and organize the pavlovia data. Then, computes measures of interest.
1+
22
# For each participant, a single, new, organized csv file that has all the necessary information will be generated.
33
# Author: Kianoosh Hosseini at NDCLab @FIU (https://Kianoosh.info; https://NDClab.com)
4-
# Last Update: 2024-08-19 (YYYY-MM-DD)
5-
# This version computes post-trial hit rates as well.
4+
# Last Update: 2025-10-16 (YYYY-MM-DD)
5+
66
library(tidyverse)
77
library(dplyr)
88
library(stringr)
99
library(psycho) # to compute d' measures, etc.
1010

1111
#Working directory should be the Psychopy experiment directory.
12-
proje_wd <- "/GitHub_Repos/mfe-c-dataset"
12+
proje_wd <- "/Github_Repos/mfe-c-dataset"
1313
setwd(proje_wd)
1414

1515
input_raw_path <- paste(proje_wd, "sourcedata", "checked", "psychopy", "mfe-c-face", sep ="/", collapse = NULL) # input data directory

code/stats/mfe_c_object_data_organizer.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This script will load, and organize the Psychopy data for the mfe_c_object study.
1+
# This script will load, and organize the Psychopy data for the mfe_c_object.
22
# For each participant, a single, new, organized csv file that has all the necessary information will be generated.
33
# Author: Kianoosh Hosseini at NDCLab @FIU (https://Kianoosh.info; https://NDClab.com)
4-
# Last Update: 2024-08-15 (YYYY-MM-DD)
4+
# Last Update: 2025-10-16 (YYYY-MM-DD)
55

66
library(tidyverse)
77
library(dplyr)
@@ -10,7 +10,7 @@ library(stringr)
1010

1111

1212
#Working directory should be the Psychopy experiment directory.
13-
proje_wd <- "/GitHub_Repos/mfe-c-dataset"
13+
proje_wd <- "/Github_Repos/mfe-c-dataset"
1414
setwd(proje_wd)
1515

1616
# Defining the input and output folders.

code/stats/mfe_c_object_measure_computations.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# This script will load, and organize the pavlovia data. Then, computes measures of interest.
2-
# For each participant, a single, new, organized csv file that has all the necessary information will be generated.
1+
2+
33
# Author: Kianoosh Hosseini at NDCLab @FIU (https://Kianoosh.info; https://NDClab.com)
4-
# Last Update: 2024-02-14 (YYYY-MM-DD)
4+
# Last Update: 2025-10-16 (YYYY-MM-DD)
55

66
library(tidyverse)
77
library(dplyr)
88
library(stringr)
99
library(psycho) # to compute d' measures, etc.
1010

1111
#Working directory should be the Psychopy experiment directory.
12-
proje_wd <- "/GitHub_Repos/mfe-c-dataset"
12+
proje_wd <- "/Github_Repos/mfe-c-dataset"
1313
setwd(proje_wd)
1414

1515
input_raw_path <- paste(proje_wd, "sourcedata", "checked", "psychopy", "mfe-c-object", sep ="/", collapse = NULL) # input data directory
@@ -297,7 +297,7 @@ for (subject in 1:length(raw_datafiles_list)){
297297

298298

299299
### Loading RedCap questionnaire data
300-
redcapDat <- read.csv(file = "/GitHub_Repos/mfe-c-object-dataset/derivatives/redcap/202402v0memoryforerr_SCRD_2024-09-10_1142.csv")
300+
redcapDat <- read.csv(file = "/Github_Repos/mfe-c-object-dataset/derivatives/redcap/202402v0memoryforerr_SCRD_2024-09-10_1142.csv")
301301

302302
#
303303

sourcedata/.DS_Store

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)