Commit 9d1d4d85 authored by Bonte Bruno's avatar Bonte Bruno

nice graphs

parent 87f33980
...@@ -91,6 +91,55 @@ data %>% ...@@ -91,6 +91,55 @@ data %>%
geom_density(aes(x= reactionTime, color=trial), size =1.5) + geom_density(aes(x= reactionTime, color=trial), size =1.5) +
ggsave("per-trial-reaction-times.pdf") ggsave("per-trial-reaction-times.pdf")
alldata <- read.table("alldata-expe-lem.csv",
sep=",",
dec= ".",
header = T) %>%
tbl_df()
iat_scores <- alldata %>%
filter(reactionTime < 3000) %>%
filter(reactionTime > 300) %>%
filter(trial == 4 | (trial ==6)) %>%
group_by(id) %>%
mutate(full.sd = sd(reactionTime)) %>%
group_by(id, trial, full.sd) %>%
summarise(mRT = mean(reactionTime), sdRT = sd(reactionTime)) %>%
gather(variable,value, -id, -full.sd, -trial) %>%
unite(block, trial, variable) %>%
spread(block,value, sep = "") %>%
mutate(d = round((block6_mRT - block4_mRT) / full.sd, digits=5))
alldata %>%
filter(reactionTime < 3000) %>%
filter(reactionTime > 300) %>%
filter(trial == 4 | (trial ==6)) %>%
mutate(category = recode_factor(category,
"A"= "Appropriation",
"P"= "Partage",
"1"= "Moi",
"2"= "PasMoi")) %>%
mutate(trial=as.factor(trial)) %>%
left_join(iat_scores, by='id') %>%
mutate(lab = paste0("id: ", as.numeric(as.factor(id)),"(d=",d,")")) %>%
ggplot() +
geom_histogram(aes(x= reactionTime, fill=trial), position = "dodge") +
facet_wrap(~lab, scales ="free_x") +
ggsave("per-trial-reaction-times-alldata.pdf",
height = 21,
width = 29.7,
units = "cm")
iat_scores %>%
arrange(d) %>%
mutate(lab = paste0(as.numeric(as.factor(id)))) %>%
ggplot() +
geom_bar(aes(x=lab, y=d), stat="identity") +
ggsave("scores-alldata.pdf",
height = 21 / 2,
width = 29.7 /2,
units = "cm")
items <- list(c("compétition", items <- list(c("compétition",
"gain", "gain",
"profit", "profit",
......
...@@ -86,19 +86,3 @@ setwd(paste(base.dir,"data",sep="")) ...@@ -86,19 +86,3 @@ setwd(paste(base.dir,"data",sep=""))
write.csv(alldata, write.csv(alldata,
paste0("alldata-", expe.name,".csv"), paste0("alldata-", expe.name,".csv"),
row.names = F) row.names = F)
alldata %>%
filter(reactionTime < 2000) %>%
mutate(category = recode_factor(category,
"A"= "Appropriation",
"P"= "Partage",
"1"= "Moi",
"2"= "PasMoi")) %>%
mutate(trial=as.factor(trial)) %>%
ggplot() +
geom_density(aes(x= reactionTime, color=trial), size =1.5) +
facet_wrap(~id, scales ="free_x") +
ggsave("per-trial-reaction-times-alldata.pdf")
summarized %>% tbl_df()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment