*Question*: Does association-type position predict accuracy?

Read in data

```
# tdcs data
d.all = read.csv("../data/labDataPlusNorms.csv") %>%
rename(condition = electrode,
association.num = mention) %>%
select(1:4,7,9:19,21,22) %>%
mutate(condition = fct_recode(condition, "sham" = "na"))
# turker accuracy data
d.bw = read.csv("../data/backALLfinal_withALLSimilaritiesPlusNorms.csv") %>%
select(cue, labSubj, subjCode, isRight)
```

Calculate the proportion of turkers for each list that correctly guesed the cue. We then assign that list a 1 if it was guessed correctly more often than the median, and 0 if less.

```
# add trial-wise accuracy column to tdcs data based on turker data
prop.correct = d.bw %>%
group_by(cue, labSubj) %>%
summarize(prop.turk.correct = sum(isRight)/length(isRight))
median.correct = median(prop.correct$prop.turk.correct)
d.all.bw = left_join(d.all, prop.correct) %>%
mutate(above.median = ifelse(prop.turk.correct > median.correct, 1, 0)) %>%
mutate(above.median = as.factor(above.median)) %>%
filter(!is.na(above.median))
```

Distributions of word types across association numbers, split by correctness.

```
cat.dists = d.all.bw %>%
select(-hyponym, -hypernym, -meronymPart,
-meronymSubstance, -taxonomic, -synonym) %>%
gather("category", "present", 6:12) %>%
filter(present == 1, category != "metaphor", category != "holonym")
ggplot(cat.dists, aes(x = association.num,
group = above.median, fill = above.median)) +
geom_histogram(position = "dodge", binwidth =1) +
facet_grid(~category)
```