This script analyzes data for sol-gating experiment. The goal of this analysisis to find the precise gate when participants can reliably identify the sign for each sign used in the SOL stimulus set.

Load libraries.

Read in data.

df <- read.csv("../data/sol-gating/sol-gating-processed-df.csv")

Descriptives

df %>%
    group_by(id) %>%
    mutate(num_trials = max(trial)) %>%
    select(id, gender, age, asl_fluency, age_learned_asl, num_trials) %>%
    distinct()
## Source: local data frame [1 x 6]
## Groups: id
## 
##   id gender age asl_fluency age_learned_asl num_trials
## 1 11   Male  27 [undefined]               0        228

Histogram of main outcome variable –> Correct on 2-AFC measure

qplot(x=correct, data=df)

Histogram rt just to make sure nothing weird is going on

qplot(x=rt, data=df)
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

Main analysis

Plot accuracy for each gate within each sign.

ms <- df %>%
    group_by(gate_name, gate_num) %>%
    summarise(mean_correct = mean(correct))
    
ms_2 <- df %>% 
    group_by(gate_name) %>%
    summarise(tot_correct = sum(correct))

ms <- left_join(ms, ms_2, by = "gate_name") 

Now plot

ms <- ms %>%
    ungroup %>%
    arrange(tot_correct)
    
# now plot
qplot(x=gate_num, y=mean_correct, data=ms, color=as.factor(tot_correct)) +
    facet_wrap(tot_correct ~ gate_name, nrow=8, ncol=5) +
    geom_line() +
    theme_bw()