Read in turker accuracy data

d.bw.raw = read.csv("../data/backALLfinal_withALLSimilaritiesPlusNorms.csv")

Number of incorrect guesses

d.bw2 = d.bw.raw %>%
       select(electrode,  labSubj,  subjCode, cue, 
             turkerGuess, isRight) %>%
        rename(condition = electrode)  %>%     
        mutate(condition = fct_recode(condition, "sham" = "na")) %>%
        mutate(turkerGuess= str_trim(turkerGuess))

cue.ns = d.bw2 %>%
  filter(isRight == 0) %>%
  group_by(condition, cue) %>%
  summarize(n = length(unique(turkerGuess))) 

The data:

spread(cue.ns, condition, n) %>%
  select(-sham) %>%
  mutate(dif = cathodal-anodal) %>%
  arrange(-dif) %>%
  as.data.frame()
##            cue anodal cathodal dif
## 1    alligator     27       42  15
## 2          cow     19       33  14
## 3       pencil     35       48  13
## 4          car     41       53  12
## 5         tree     44       56  12
## 6        spoon     34       45  11
## 7       wrench     57       68  11
## 8        couch     55       64   9
## 9          owl     40       49   9
## 10        bird     33       41   8
## 11        book     43       51   8
## 12      carrot     40       48   8
## 13       phone     25       33   8
## 14        fish     52       59   7
## 15 grasshopper     57       64   7
## 16      toilet     35       42   7
## 17         bed     38       44   6
## 18      banana     28       32   4
## 19      hammer     56       60   4
## 20    umbrella     53       56   3
## 21    scissors     56       58   2
## 22       table     64       66   2
## 23        ball     54       55   1
## 24     bicycle     48       49   1
## 25      bottle     59       60   1
## 26        frog     33       34   1
## 27        duck     40       40   0
## 28       water     41       41   0
## 29         key     66       65  -1
## 30  motorcycle     62       61  -1
## 31       zebra     23       22  -1
## 32       chair     58       56  -2
## 33        hand     81       78  -3
## 34        lime     51       48  -3
## 35      rabbit     28       23  -5
## 36      lizard     52       44  -8
## 37         dog     39       25 -14
## 38      bucket     72       57 -15
## 39       purse     68       53 -15

Means:

cue.ms = cue.ns %>%
  group_by(condition) %>%
  multi_boot_standard(column = "n", na.rm = T) 

kable(cue.ms)
condition mean ci_lower ci_upper
anodal 46.33333 41.87115 50.66731
cathodal 49.30769 45.30705 53.26090
sham 52.02564 47.97372 56.38526
ggplot(cue.ms, aes(x = condition, y = mean, fill = condition)) +
    geom_bar(position = "dodge", stat = "identity") +
    geom_linerange(aes(ymax = ci_upper, ymin = ci_lower)) +
    ggtitle("mean number of unique wrong guesses") +
    theme_bw() +
    theme(legend.position = "none")

paired-test:

tidy(t.test(filter(cue.ns, condition == "anodal")$n, 
            filter(cue.ns, condition == "cathodal")$n, paired=TRUE))  %>%
  kable()
estimate statistic p.value parameter conf.low conf.high method alternative
-2.974359 -2.447356 0.0191244 38 -5.434677 -0.5140406 Paired t-test two.sided

The mixed-effect model with orthogonal contrasts:

contrasts(cue.ns$condition) <- c(.5, -.5, 0)
colnames(contrasts(cue.ns$condition)) <- c('anodalVScathodal','experimentalVSsham')
  
M16a <- lmer(scale(n) ~ condition + (1|cue), data = cue.ns)
wrong.base <- lmer(scale(n) ~ 1 + (1|cue), data = cue.ns)
kable(tidy(anova(M16a, wrong.base, test = "Chi")))
term df AIC BIC logLik deviance statistic Chi.Df p.value
wrong.base 3 278.2508 286.5373 -136.1254 272.2508 NA NA NA
M16a 5 270.5438 284.3546 -130.2719 260.5438 11.70703 2 0.0028698
summary(M16a)
## Linear mixed model fit by REML ['lmerMod']
## Formula: scale(n) ~ condition + (1 | cue)
##    Data: cue.ns
## 
## REML criterion at convergence: 268.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.23385 -0.62966  0.00387  0.47412  2.56201 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  cue      (Intercept) 0.7222   0.8498  
##  Residual             0.2666   0.5163  
## Number of obs: 117, groups:  cue, 39
## 
## Fixed effects:
##                               Estimate Std. Error t value
## (Intercept)                 -8.803e-16  1.442e-01   0.000
## conditionanodalVScathodal   -2.143e-01  1.169e-01  -1.832
## conditionexperimentalVSsham  2.473e-01  8.267e-02   2.991
## 
## Correlation of Fixed Effects:
##             (Intr) cndtnnVS
## cndtnndlVSc 0.000          
## cndtnxprmVS 0.000  0.000

Mixed-effect model with only experimental contrast:

experiment.cues = filter(cue.ns, condition != "sham") %>%
  ungroup() %>%
  mutate(condition = droplevels(condition))
  
M16b <- lmer(scale(n) ~ condition + (1|cue), data = experiment.cues)
wrong.base <- lmer(scale(n) ~ 1 + (1|cue), data = experiment.cues)
kable(tidy(anova(M16b, wrong.base, test = "Chi")))
term df AIC BIC logLik deviance statistic Chi.Df p.value
wrong.base 3 181.2404 188.3105 -87.62021 175.2404 NA NA NA
M16b 4 177.5321 186.9590 -84.76607 169.5321 5.708273 1 0.0168851
summary(M16b)
## Linear mixed model fit by REML ['lmerMod']
## Formula: scale(n) ~ condition + (1 | cue)
##    Data: experiment.cues
## 
## REML criterion at convergence: 174.5
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.82116 -0.46072  0.05351  0.48251  1.92734 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  cue      (Intercept) 0.8507   0.9223  
##  Residual             0.1506   0.3881  
## Number of obs: 78, groups:  cue, 39
## 
## Fixed effects:
##                   Estimate Std. Error t value
## (Intercept)       -0.10754    0.16023  -0.671
## conditioncathodal  0.21508    0.08788   2.447
## 
## Correlation of Fixed Effects:
##             (Intr)
## condtncthdl -0.274