Commit 87f33980 authored by Bonte Bruno's avatar Bonte Bruno

first analysis of real data from leem at home

parent 65078242
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
0,0,P,2,0,1119
0,1,P,1,0,561
0,2,A,2,0,654
0,3,P,1,0,525
0,4,A,2,1,1118
0,5,A,3,0,864
0,6,P,0,0,623
0,7,P,2,0,624
0,8,A,4,0,656
0,9,A,0,0,673
0,10,P,3,0,718
0,11,P,2,1,1199
0,12,A,3,0,686
0,13,A,0,0,655
0,14,A,4,0,624
0,15,P,3,0,640
0,16,A,2,0,880
0,17,A,1,0,976
0,18,P,2,0,767
0,19,P,1,0,784
1,0,2,0,0,907
1,1,2,1,0,688
1,2,2,0,0,672
1,3,2,2,0,687
1,4,1,0,0,576
1,5,2,2,0,624
1,6,1,0,0,880
1,7,2,1,0,640
1,8,2,2,0,736
1,9,1,1,0,686
1,10,2,2,0,864
1,11,2,1,1,1119
1,12,1,2,1,1201
1,13,2,1,0,831
1,14,1,0,0,705
1,15,2,1,0,879
1,16,2,0,1,1104
1,17,2,2,1,1231
1,18,2,1,0,1231
1,19,1,0,0,719
2,0,P,4,0,1567
2,1,1,0,0,976
2,2,A,3,1,1264
2,3,1,1,0,1344
2,4,P,0,0,1600
2,5,2,2,1,1105
2,6,P,2,0,1246
2,7,2,0,0,1744
2,8,P,4,0,798
2,9,1,1,0,911
2,10,A,1,1,1745
2,11,2,0,0,656
2,12,A,0,0,848
2,13,1,1,0,1150
2,14,A,1,0,3471
2,15,2,2,0,862
2,16,P,3,1,1838
2,17,1,0,0,1200
2,18,P,0,0,1728
2,19,1,1,0,1055
2,20,A,2,2,2895
2,21,2,0,0,1408
2,22,A,3,0,2240
2,23,1,1,0,1088
2,24,P,2,0,1168
2,25,1,0,0,991
2,26,A,3,0,800
2,27,1,2,0,1136
2,28,P,2,1,2522
2,29,2,1,0,1094
2,30,A,3,0,1376
2,31,2,2,0,1151
2,32,A,1,0,1360
2,33,1,1,0,128
2,34,A,2,1,2031
2,35,1,0,0,1056
2,36,A,1,0,1617
2,37,2,1,0,1007
2,38,P,4,0,1679
2,39,1,2,0,863
3,0,A,4,1,2032
3,1,1,2,0,943
3,2,P,0,0,976
3,3,1,1,0,880
3,4,A,4,1,1439
3,5,2,2,0,849
3,6,P,3,0,2000
3,7,1,0,0,976
3,8,P,2,1,2271
3,9,2,2,0,737
3,10,A,1,0,1998
3,11,2,1,0,831
3,12,P,0,1,1680
3,13,2,2,0,1232
3,14,P,2,0,1984
3,15,2,0,0,959
3,16,A,1,0,1360
3,17,1,1,0,1296
3,18,A,0,0,1391
3,19,1,2,0,1280
3,20,A,2,0,1903
3,21,2,0,0,1039
3,22,A,0,0,1279
3,23,1,2,0,1102
3,24,A,2,0,1745
3,25,2,1,0,863
3,26,P,4,0,735
3,27,2,0,0,2143
3,28,A,3,0,944
3,29,2,2,0,1103
3,30,A,0,0,1344
3,31,2,0,0,1345
3,32,A,2,0,1679
3,33,2,1,1,2032
3,34,P,3,1,3568
3,35,1,2,0,944
3,36,A,0,1,1952
3,37,1,1,0,1391
3,38,P,2,0,1488
3,39,2,2,0,991
4,0,A,1,1,1951
4,1,A,0,0,1376
4,2,A,1,0,1248
4,3,P,2,0,577
4,4,P,4,0,639
4,5,A,2,0,960
4,6,P,3,0,1168
4,7,A,0,0,863
4,8,P,2,0,912
4,9,P,0,0,735
4,10,P,1,0,592
4,11,A,4,0,640
4,12,A,0,0,816
4,13,A,3,0,688
4,14,P,1,0,688
4,15,A,3,0,863
4,16,A,0,0,736
4,17,P,2,0,880
4,18,A,4,0,784
4,19,A,2,0,1008
5,0,A,1,1,2528
5,1,2,2,0,1168
5,2,P,0,0,1168
5,3,2,1,0,1103
5,4,P,2,0,2528
5,5,1,2,0,528
5,6,A,1,0,1120
5,7,1,1,0,992
5,8,A,4,0,1007
5,9,1,2,0,721
5,10,P,2,0,800
5,11,2,1,0,815
5,12,A,3,1,1199
5,13,1,2,0,990
5,14,P,4,0,1313
5,15,1,0,0,832
5,16,A,1,0,1040
5,17,1,1,0,847
5,18,P,0,0,833
5,19,1,2,0,608
5,20,A,4,0,767
5,21,1,1,0,688
5,22,P,3,0,848
5,23,2,2,0,704
5,24,P,1,0,703
5,25,1,0,0,608
5,26,A,3,1,1296
5,27,2,2,1,1536
5,28,P,2,1,3215
5,29,2,1,0,1392
5,30,A,1,0,1952
5,31,2,2,0,800
5,32,P,4,0,1215
5,33,2,1,0,735
5,34,A,1,1,1279
5,35,2,0,0,1040
5,36,P,2,0,703
5,37,2,2,0,703
5,38,A,4,0,721
5,39,1,0,0,686
6,0,P,4,0,3166
6,1,1,0,0,721
6,2,P,2,0,1023
6,3,2,1,1,1120
6,4,A,4,0,1296
6,5,2,0,0,2304
6,6,P,3,0,991
6,7,2,2,0,912
6,8,P,0,2,1407
6,9,1,0,0,878
6,10,P,4,0,1456
6,11,2,1,0,719
6,12,P,2,0,752
6,13,2,0,0,767
6,14,P,0,0,784
6,15,1,1,0,960
6,16,A,1,0,752
6,17,2,0,0,1168
6,18,P,3,0,848
6,19,2,1,0,720
6,20,A,4,0,912
6,21,1,0,0,880
6,22,A,2,0,927
6,23,2,2,0,1040
6,24,P,0,0,848
6,25,1,0,0,656
6,26,A,3,1,1407
6,27,2,1,1,1439
6,28,A,0,1,2577
6,29,2,2,0,1168
6,30,P,3,0,1280
6,31,1,0,0,560
6,32,P,0,0,768
6,33,1,1,0,991
6,34,P,2,0,689
6,35,2,0,0,688
6,36,A,3,0,1071
6,37,2,2,0,815
6,38,A,1,0,1280
6,39,2,1,0,753
This diff is collapsed.
"Id","Date","Block4.m","Block4.sd","Block7.m","Block7.sd","diff","full.sd","d"
"1832683201","02-01-2020 15:06",989.5,444.428183463212,825.9,318.103256901406,-163.6,392.73202123882,-0.416569037288953
"222109674","02-03-2020 11:06",943.128205128205,352.016834188305,907.815789473684,254.652795449885,-35.3124156545209,306.340456670398,-0.115271799351382
"223517612","02-02-2020 16:58",719,169.297038306898,811.538461538462,294.820806070921,92.5384615384615,242.577798480162,0.381479517574356
"238416187","02-01-2020 17:21",1078.6,448.134469288073,996.2,360.923473670187,-82.3999999999999,406.409334089958,-0.202751248773634
"303732253","02-01-2020 22:52",620.205882352941,183.401824023804,644.325,184.013152748969,24.1191176470588,182.871300714338,0.13189121285212
"370634186","02-03-2020 18:39",1063.65,427.427579710804,897.675,358.958135370572,-165.975,400.967499038027,-0.413936292587792
"370770958","02-02-2020 13:25",825.575,330.116520803931,885.675,262.64047645364,60.0999999999999,297.937227905732,0.201720343652441
"3714116","02-02-2020 10:04",930.526315789474,460.305934507493,902.025,338.827956305791,-28.5013157894737,400.208036352311,-0.0712162505512094
"398609443","02-01-2020 12:44",1167.03333333333,590.534152320991,822.542857142857,296.108718394518,-344.490476190476,484.306142748413,-0.711307261633128
"411898080","02-01-2020 13:41",914.25,436.040797314973,1185.84210526316,470.977392371627,271.592105263158,470.69828176962,0.576998293348534
"487953098","02-01-2020 12:41",797.2,345.707909910026,913.128205128205,314.853698647414,115.928205128205,333.848525591469,0.347247917069032
"606820006","02-01-2020 11:33",1024.02564102564,418.389109195803,1298.16666666667,742.356630378329,274.141025641026,471.895187172711,0.580936261044535
"642119270","02-02-2020 13:17",839.375,214.476546742445,804.65,234.344098304729,-34.725,223.886640266617,-0.155100813334139
"649738704","02-03-2020 17:04",823.175,325.729232173454,670.55,169.259919983499,-152.625,269.107232109094,-0.567153096569798
"658909377","02-01-2020 12:09",893.368421052632,382.017575727881,760.717948717949,373.883456983868,-132.650472334683,381.312302149216,-0.347878816358707
"71044925","02-01-2020 18:03",720.7,297.101225950918,658.25,189.538948030511,-62.45,249.596432494385,-0.250203896649865
"785118707","02-01-2020 18:06",1047.25641025641,482.35942691539,1270.4358974359,418.296280974936,223.179487179487,462.37231517702,0.48268349953877
"805273055","02-01-2020 15:50",811.775,295.630095229035,929,289.523304052962,117.225,296.65751867444,0.395152634336721
"821663749","02-01-2020 14:46",1230.35135135135,597.422296956601,806.95,251.229280303971,-423.401351351351,496.780377709683,-0.852290811693021
"892365728","02-01-2020 14:44",742.692307692308,303.580055673012,842.641025641026,369.196459410198,99.9487179487179,339.528728645688,0.294374848182636
"908597188","02-01-2020 12:29",918.8,411.190716247589,787.325,353.991336088387,-131.475,386.919556083363,-0.339799314697015
"910309212","02-01-2020 12:51",838.675,300.968129116007,833.875,344.725545794153,-4.79999999999995,321.541854078206,-0.0149280721595655
"914111852","02-01-2020 13:56",1069.52777777778,382.911812757463,903.85,256.041818499465,-165.677777777778,330.828833413208,-0.500796064443528
"920781648","02-03-2020 14:14",802.925,265.786147648916,1075.9,355.64140683617,272.975,340.84978293277,0.800865993374689
"945011642","02-01-2020 18:49",835.85,320.558211042342,1100.575,554.992487244139,264.725,469.605023741,0.563718415725474
"998034479","02-01-2020 12:47",1026.17948717949,347.779563561905,848.4,277.659614525522,-177.779487179487,324.766836691903,-0.547406530144398
"bru","01-24-2019 17:15",1362.46153846154,451.686421626532,1034.02564102564,410.675533800199,-328.435897435897,459.603419841284,-0.714607166215859
......@@ -6,7 +6,7 @@ library(stringr)
library(RColorBrewer)
#set working directory where this source file is
setwd("/home/bonte/git/aiat")
setwd("/home/bruno/git/aiat")
#############################################################
## Pour comparer les résultats d'éxpériences ################
......@@ -80,6 +80,7 @@ data %>%
data %>%
filter(reactionTime < 2000) %>%
mutate(category = recode_factor(category,
"A"= "Appropriation",
"P"= "Partage",
......
#load basic libraries for graphs
library(dplyr)
library(tidyr)
library(ggplot2)
library(stringr)
# Set the path to the IAT folder here (be sure to include trailing slash)
# on Linux (use a single forward slash):
base.dir = "~/git/aiat/"
# on Windows (use double forward slashes):
# base.dir = "C://Users//winteram//Documents//IAT//"
# File delimiter = '/' for Unix/Max, '//' for Windows
fd = '/'
# Set the template you want to analyze here
expe.name = "expe-lem"
output.dir = paste(base.dir,"data",fd,expe.name,sep="")
# Summary from IATmaster package analysis
#----------------------------------------
setwd(output.dir)
output.files = list.files()
data.list = lapply(output.files, read.table, sep = ",")
summarized <- data.frame(matrix(ncol=9,nrow=length(data.list)))
names(summarized) <- c("Id","Date","Block4.m","Block4.sd","Block7.m","Block7.sd","diff","full.sd",'d')
for(i in 1:length(data.list))
{
filename = strsplit(output.files[i],'-')
id = filename[[1]][2]
iat.date = paste(filename[[1]][4],"-",filename[[1]][5],"-",filename[[1]][3]," ",filename[[1]][6],":",substr(filename[[1]][7],1,2),sep="")
block4.m = mean(as.numeric(unlist(subset(data.list[[i]], V1==3 & V6>300 & V6 < 3000, select="V6"))))
block7.m = mean(as.numeric(unlist(subset(data.list[[i]], V1==6 & V6>300 & V6 < 3000, select="V6"))))
block4.sd = sd(as.numeric(unlist(subset(data.list[[i]], V1==3 & V6>300 & V6 < 3000, select="V6"))))
block7.sd = sd(as.numeric(unlist(subset(data.list[[i]], V1==6 & V6>300 & V6 < 3000, select="V6"))))
full.sd = sd(as.numeric(unlist(subset(data.list[[i]], (V1==6 | V1==3) & V6>300 & V6 < 3000, select="V6"))))
diff = block7.m - block4.m
d = diff / full.sd
summarized[i,] = c(id, iat.date, block4.m, block4.sd, block7.m, block7.sd, diff, full.sd, d)
}
rm(block4.m,block4.sd,block7.m,block7.sd,d,data.list,diff,filename,full.sd,i,iat.date,id,output.files)
setwd(paste(base.dir,"data",sep=""))
write.csv(summarized %>%
mutate(Block4.m = as.numeric(Block4.m)) %>%
mutate(Block4.sd = as.numeric(Block4.sd)) %>%
mutate(Block7.m = as.numeric(Block7.m)) %>%
mutate(Block7.sd = as.numeric(Block7.sd)) %>%
mutate(diff = as.numeric(diff)) %>%
mutate(d = as.numeric(d)) %>%
mutate(full.sd = as.numeric(full.sd)),
paste0("summarized-", expe.name,".csv"),
row.names = F)
summarized %>% tbl_df()
# Compilation of all datas of an experiment in a single file
#----------------------------------------
setwd(output.dir)
output.files = list.files()
data.list = lapply(output.files, read.table, sep = ",")
alldata <- NULL
for(i in 1:length(data.list))
{
filename = strsplit(output.files[i],'-')
dat <- as.data.frame(data.list[[i]])
colnames(dat) <- c("trial",
"round",
"category",
"item",
"error",
"reactionTime")
dat$id <- filename[[1]][2]
alldata <- alldata %>%
rbind(dat)
}
alldata %>%
tbl_df()
setwd(paste(base.dir,"data",sep=""))
write.csv(alldata,
paste0("alldata-", expe.name,".csv"),
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