rm(list=ls())
library(ggplot2)
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.1.2
## 
## Attaching package: 'dplyr'
## 
## The following object is masked from 'package:stats':
## 
##     filter
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
## Warning: package 'tidyr' was built under R version 3.1.2
d <- read.csv("/Users/ericang/Documents/Research/Politeness/child_experiment/trupol_coding.csv")
d$trial1_niceness <- as.numeric(as.character(d$trial1_niceness))
## Warning: NAs introduced by coercion
d$trial2_niceness <- as.numeric(as.character(d$trial2_niceness))
d$trial3_niceness <- as.numeric(as.character(d$trial3_niceness))
## Warning: NAs introduced by coercion
d$trial4_niceness <- as.numeric(as.character(d$trial4_niceness))

Niceness ratings trial 1: mean trial 2: nice trial 3: nice trial 4: mean

qplot(data=d[d$trial1_niceness != "NA",], x=trial1_niceness,
      geom="histogram")
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

plot of chunk unnamed-chunk-2

qplot(data=d[d$trial2_niceness != "NA",], x=trial2_niceness,
      geom="histogram")
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

plot of chunk unnamed-chunk-2

qplot(data=d[d$trial3_niceness != "NA",], x=trial3_niceness,
      geom="histogram")
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

plot of chunk unnamed-chunk-2

qplot(data=d[d$trial4_niceness != "NA",], x=trial4_niceness,
      geom="histogram")
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

plot of chunk unnamed-chunk-2

comparison of two characters Q1: “Who do you want to play with?” Q2: “Whose candy/drawing do you think is tastier/prettier?”

d <- d %>%
  filter(trial1_2_playCorrect == "Y" | trial1_2_playCorrect == "N") %>%
  filter(trial1_2_evalCorrect == "Y" | trial1_2_evalCorrect == "N") %>%
  filter(trial3_4_playCorrect == "Y" | trial3_4_playCorrect == "N") %>%
  filter(trial3_4_evalCorrect == "Y" | trial3_4_evalCorrect == "N")

qplot(data=d, x=trial1_2_playCorrect,
      geom="histogram")

plot of chunk unnamed-chunk-3

qplot(data=d, x=trial3_4_playCorrect,
      geom="histogram")

plot of chunk unnamed-chunk-3

qplot(data=d, x=trial1_2_evalCorrect,
      geom="histogram") 

plot of chunk unnamed-chunk-3

qplot(data=d, x=trial3_4_evalCorrect,
      geom="histogram") 

plot of chunk unnamed-chunk-3

Did presenting Q2 first help?

qplot(data=d, x=trial1_2_evalCorrect,
      geom="histogram") +
  facet_wrap(~order)

plot of chunk unnamed-chunk-4

qplot(data=d, x=trial3_4_evalCorrect,
      geom="histogram") +
    facet_wrap(~order)

plot of chunk unnamed-chunk-4

Comprehension of what the character said

d <- d %>%
  filter(trial1_comp_tell!= "") %>%
  filter(trial2_comp_tell!= "") %>%
  filter(trial3_comp_tell!= "") %>%
  filter(trial4_comp_tell!= "")

qplot(data=d, x=trial1_comp_tell,
      geom="histogram")

plot of chunk unnamed-chunk-5

qplot(data=d, x=trial2_comp_tell,
      geom="histogram")

plot of chunk unnamed-chunk-5

qplot(data=d, x=trial3_comp_tell,
      geom="histogram") 

plot of chunk unnamed-chunk-5

qplot(data=d, x=trial4_comp_tell,
      geom="histogram") 

plot of chunk unnamed-chunk-5

What if we look at data from only those participants who got the comprehension question correct?

d1 <- d %>%
  filter(trial1_comp_tell == "Y") %>%
  filter(trial2_comp_tell == "Y")
qplot(data=d1, x=trial1_2_playCorrect,
      geom="histogram")

plot of chunk unnamed-chunk-6

qplot(data=d1, x=trial1_2_evalCorrect,
      geom="histogram") 

plot of chunk unnamed-chunk-6

d1 <- d %>%
  filter(trial3_comp_tell == "Y") %>%
  filter(trial4_comp_tell == "Y")
qplot(data=d1, x=trial3_4_playCorrect,
      geom="histogram")

plot of chunk unnamed-chunk-6

qplot(data=d1, x=trial3_4_evalCorrect,
      geom="histogram") 

plot of chunk unnamed-chunk-6