Read in the data

setwd('~/Dropbox/Tufts/Assoc')
df = read.csv('associations_bybreadth_val.csv')

head(df)
##     word resp_type      response lsa_assoc valence
## 1  ADULT     broad           big     -0.06    5.30
## 2  ADULT     broad        nature     -0.06    7.65
## 3  ADULT     broad entertainment      0.00    5.80
## 4  ADULT     broad           man     -0.02    6.73
## 5  ADULT     broad          film     -0.01    6.93
## 6 ADVICE     broad           mom     -0.09    5.40
str(df)
## 'data.frame':    1790 obs. of  5 variables:
##  $ word     : Factor w/ 179 levels "ADULT","ADVICE",..: 1 1 1 1 1 2 2 2 2 2 ...
##  $ resp_type: Factor w/ 2 levels "broad","narrow": 1 1 1 1 1 1 1 1 1 1 ...
##  $ response : Factor w/ 1299 levels "","21","a la mode",..: 102 748 338 670 392 720 247 1176 610 237 ...
##  $ lsa_assoc: num  -0.06 -0.06 0 -0.02 -0.01 -0.09 -0.07 -0.01 0.04 0.01 ...
##  $ valence  : num  5.3 7.65 5.8 6.73 6.93 5.4 4 6.6 7.63 5.17 ...

Plot valence by cue-response associativity

library(ggplot2)

# change background to white, increase font size
theme_set(theme_bw(base_size = 18)) 

# set up basic scatter plot, overlaid with linreg
ggplot(df, aes(x=lsa_assoc, y=valence)) +
    geom_point(shape=16, 
               color = 'black',
               alpha = 0.5) +
  geom_smooth(method=lm, color = 'red')
## Warning: Removed 3 rows containing missing values (stat_smooth).
## Warning: Removed 3 rows containing missing values (geom_point).

plot of chunk unnamed-chunk-2

p = ggplot(df, aes(resp_type, valence))

p + geom_boxplot(notch = TRUE,
                 aes(fill = factor(resp_type))) +
  geom_jitter(alpha = 0.5)
## Warning: Removed 3 rows containing non-finite values (stat_boxplot).
## Warning: Removed 3 rows containing missing values (geom_point).

plot of chunk unnamed-chunk-3