knitr::opts_chunk$set(echo = FALSE)
library(knitr)
library(ggplot2)
library(tidyr)
library(plyr)
library(dplyr)
library(lazyeval)
library(outliers)
library(gtools)


source("../R/brt_append.R") # loading in helper functions
source("../R/clean_grade_gender.R")
source("../R/get_outlier_subs.R")
# note to self: now I am extremely concerned about multiple comparisons... I'll do an FDR using n = n_modules * n_varspermodule at some point?
# note: does NOT support flexibility in grade labels (expects 3rd/5th/7th grade); this will be fixed later to expect grades based on what is in the cached dataframe
# Please set each of these to TRUE or FALSE depending on whether you would like info on the module printed to the summary document.
BRT_PRINT = TRUE
BOX_PRINT = TRUE
FLANK_PRINT = TRUE
SAAT_PRINT = TRUE
SPAN_PRINT = TRUE
STROOP_PRINT = TRUE
SWITCH_PRINT = TRUE
TNT_PRINT = TRUE

# Please set these to TRUE or FALSE depending on whether you would like outlier checking info or quality control histograms printed for ALL modules or not. Even if these are set to TRUE, they will not print for modules which have been turned off (set as FALSE) in the above block.
OUTLIER_PRINT = TRUE
QC_HIST_PRINT = TRUE

# Please set this to TRUE or FALSE depending on whether you would like ALL continuous x-regressors z-scored. They will always be mean-centered; this just z-scores them by further dividing them by std dev.
Z_SCORE_XREGS = FALSE
load(file = "~/Dropbox/aceR/seacrest_data/clean_data.RData")
read_chunk("../markdowns/single_module_md.R")
this_task = "BRT"
this_task_long = "BRT"
vars_of_interest = c("rt_mean.right", "rt_mean.left")
vars_of_interest_long = c("Mean RT--right hand", "Mean RT--left hand") # nice version for printing in graphs
score_vars = c("rt_mean.overall")
score_formula = NA


# when testing MEDIAN RT:
# b016 is high side (slow RT) outlier by Grubbs' two sided test (p = .020)
# no other outliers when b016 excluded
# when testing MEAN RT:
# no outliers found at this threshold (b016 is trending here though)


# always run this irrespective of BRT_PRINT
brt <- d




this_task = "BOXED"
this_task_long = "Boxed"
vars_of_interest = "rt_mean.overall"
vars_of_interest_long = "Mean overall RT" # nice version for printing in graphs
score_vars = c("rt_mean.conjunction_4", "rt_mean.conjunction_12")
score_formula = "fraction"










this_task = "FLANKER"
this_task_long = "Flanker"
vars_of_interest = c("rt_mean.congruent","rt_mean.incongruent","rt_mean.cost")
vars_of_interest_long = c("Mean RT--congruent trials", "Mean RT--incongruent trials", "Mean cost of incongruence on RT") # nice version for printing in graphs
score_vars = c("rt_mean.congruent", "rt_mean.incongruent")
score_formula = "fraction"










this_task = "SAAT"
this_task_long = "SAAT"
vars_of_interest = c("rt_mean.sustained","rt_mean.impulsive")
vars_of_interest_long = c("Mean RT--sustained trials", "Mean RT--impulsive trials") # nice version for printing in graphs
score_vars = vars_of_interest
score_formula = NA










this_task = "SPATIALSPAN"
this_task_long = "Spatial span"
vars_of_interest = "object_count_span.overall"
vars_of_interest_long = "Overall span (obj count)" # nice version for printing in graphs
# NOT running the outlier check on the object span metric... I think I broke grubbs.test
score_vars = vars_of_interest
score_formula = NA









this_task = "STROOP"
this_task_long = "Stroop task"
vars_of_interest = c("rt_mean.congruent","rt_mean.incongruent","rt_mean.cost")
vars_of_interest_long = c("Mean RT--congruent trials", "Mean RT--incongruent trials", "Mean cost of incongruence on RT") # nice version for printing in graphs
score_vars = c("rt_mean.congruent", "rt_mean.incongruent")
score_formula = "fraction"










this_task = "TASKSWITCH"
this_task_long = "Task switch"
vars_of_interest = c("rt_mean.stay","rt_mean.switch")
vars_of_interest_long = c("Mean RT--stay trials", "Mean RT--switch trials") # nice version for printing in graphs
score_vars = vars_of_interest 
score_formula = NA










this_task = "TNT"
this_task_long = "Tap and trace"
vars_of_interest = c("rt_mean.tap_only","rt_mean.tap_trace")
vars_of_interest_long = c("Mean RT--tap only trials", "Mean RT--tap and trace trials") # nice version for printing in graphs
score_vars = vars_of_interest
score_formula = NA












gazzlab/AceScripts documentation built on May 16, 2019, 10:11 p.m.