Commit 789748de authored by Bonte Bruno's avatar Bonte Bruno

Ajout des training dans les diagrammes

parent 9d1d4d85
This diff is collapsed.
"Id","Date","Block4.m","Block4.sd","Block7.m","Block7.sd","diff","full.sd","d" "Id","Date","Block4.m","Block4.sd","Block7.m","Block7.sd","diff","full.sd","d"
"100786589","02-05-2020 21:22",1199.43243243243,490.402926204596,957.846153846154,426.485363385646,-241.586278586279,471.561645055786,-0.512311128606948
"1017239621","02-10-2020 15:05",831.9,214.016989500534,800.3,193.316029287504,-31.6,203.257372544444,-0.155467915404104
"103374404","02-10-2020 10:44",936.225,535.366229191732,607.1,474.236567782602,-329.125,535.833358195533,-0.614230142573352
"124789236","02-10-2020 13:59",685.96,308.902422565228,757.75,396.915573166665,71.79,356.580968277319,0.201328748269503
"1576459677","02-05-2020 15:04",1007.575,445.584484348712,900.55,269.714088885972,-107.025,369.903249196087,-0.289332413901738
"168900812","02-10-2020 14:09",907.15,434.456191176144,805,319.572230108328,-102.15,382.413348338342,-0.267119336821952
"1831964311","02-10-2020 10:17",1070.15625,467.760768009364,1079.94736842105,486.898898844093,9.79111842105272,474.816203080807,0.0206208599401701
"1832683201","02-01-2020 15:06",989.5,444.428183463212,825.9,318.103256901406,-163.6,392.73202123882,-0.416569037288953 "1832683201","02-01-2020 15:06",989.5,444.428183463212,825.9,318.103256901406,-163.6,392.73202123882,-0.416569037288953
"19072949","02-04-2020 16:17",868.575,219.158049455241,797.315789473684,304.570153926601,-71.2592105263159,264.927420806224,-0.268976349482664
"222109674","02-03-2020 11:06",943.128205128205,352.016834188305,907.815789473684,254.652795449885,-35.3124156545209,306.340456670398,-0.115271799351382 "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 "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 "238416187","02-01-2020 17:21",1078.6,448.134469288073,996.2,360.923473670187,-82.3999999999999,406.409334089958,-0.202751248773634
"26285618","02-10-2020 10:23",653.5,155.991452757301,872.55,182.08337763304,219.05,201.314602022163,1.08809792136134
"284411184","02-10-2020 14:10",1021.10526315789,366.429432716232,1002.825,431.58657137328,-18.2802631578946,398.68181086386,-0.0458517611282169
"303732253","02-01-2020 22:52",620.205882352941,183.401824023804,644.325,184.013152748969,24.1191176470588,182.871300714338,0.13189121285212 "303732253","02-01-2020 22:52",620.205882352941,183.401824023804,644.325,184.013152748969,24.1191176470588,182.871300714338,0.13189121285212
"365542128","02-10-2020 10:02",900.775,454.743009277965,1000.38461538462,367.876238870501,99.6096153846154,414.534613900202,0.240292636717175
"370634186","02-03-2020 18:39",1063.65,427.427579710804,897.675,358.958135370572,-165.975,400.967499038027,-0.413936292587792 "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 "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 "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 "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 "411898080","02-01-2020 13:41",914.25,436.040797314973,1185.84210526316,470.977392371627,271.592105263158,470.69828176962,0.576998293348534
"42685840","02-06-2020 09:41",810.75,289.995910669665,827.589743589744,272.416352970452,16.8397435897435,279.775841673118,0.0601901275286614
"4830243","02-05-2020 12:22",1023.95,409.626030197526,984.975,381.855556494391,-38.975,393.958487299347,-0.0989317434615518
"487953098","02-01-2020 12:41",797.2,345.707909910026,913.128205128205,314.853698647414,115.928205128205,333.848525591469,0.347247917069032 "487953098","02-01-2020 12:41",797.2,345.707909910026,913.128205128205,314.853698647414,115.928205128205,333.848525591469,0.347247917069032
"51558243","02-10-2020 14:59",1284.91891891892,567.970283767772,NA,NA,NA,567.970283767772,NA
"593253971","02-10-2020 13:14",751.825,361.507377482617,1009.44736842105,559.117049939839,257.622368421053,482.913309062055,0.533475395245211
"606820006","02-01-2020 11:33",1024.02564102564,418.389109195803,1298.16666666667,742.356630378329,274.141025641026,471.895187172711,0.580936261044535 "606820006","02-01-2020 11:33",1024.02564102564,418.389109195803,1298.16666666667,742.356630378329,274.141025641026,471.895187172711,0.580936261044535
"61088246","02-10-2020 13:24",994.552631578947,461.461175045061,927.128205128205,502.043203188477,-67.4244264507423,480.464612304981,-0.140331722095578
"631328297","02-10-2020 13:42",780.525,192.600554822536,946.6,423.961947978039,166.075,337.682490512514,0.491808147197509
"642119270","02-02-2020 13:17",839.375,214.476546742445,804.65,234.344098304729,-34.725,223.886640266617,-0.155100813334139 "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 "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 "658909377","02-01-2020 12:09",893.368421052632,382.017575727881,760.717948717949,373.883456983868,-132.650472334683,381.312302149216,-0.347878816358707
"672360277","02-10-2020 16:18",891.078947368421,340.350167977196,887.125,385.704894998289,-3.95394736842104,361.962217208712,-0.0109236466692908
"71044925","02-01-2020 18:03",720.7,297.101225950918,658.25,189.538948030511,-62.45,249.596432494385,-0.250203896649865 "71044925","02-01-2020 18:03",720.7,297.101225950918,658.25,189.538948030511,-62.45,249.596432494385,-0.250203896649865
"741228137","02-10-2020 13:39",953.3,461.696492603151,990.526315789474,409.854867974355,37.2263157894737,434.781407676171,0.0856207628298591
"785118707","02-01-2020 18:06",1047.25641025641,482.35942691539,1270.4358974359,418.296280974936,223.179487179487,462.37231517702,0.48268349953877 "785118707","02-01-2020 18:06",1047.25641025641,482.35942691539,1270.4358974359,418.296280974936,223.179487179487,462.37231517702,0.48268349953877
"794559200","02-10-2020 15:14",725.425,224.2903209613,724.7,246.167047722914,-0.724999999999909,233.988009199974,-0.00309844937131073
"805273055","02-01-2020 15:50",811.775,295.630095229035,929,289.523304052962,117.225,296.65751867444,0.395152634336721 "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 "821663749","02-01-2020 14:46",1230.35135135135,597.422296956601,806.95,251.229280303971,-423.401351351351,496.780377709683,-0.852290811693021
"838929080","02-10-2020 10:13",570.125,312.268857374081,1330,1261.4784976368,759.875,596.076700881131,1.27479399694157
"892365728","02-01-2020 14:44",742.692307692308,303.580055673012,842.641025641026,369.196459410198,99.9487179487179,339.528728645688,0.294374848182636 "892365728","02-01-2020 14:44",742.692307692308,303.580055673012,842.641025641026,369.196459410198,99.9487179487179,339.528728645688,0.294374848182636
"89685998","02-10-2020 13:02",839.425,204.445703092094,734.225,270.261173539739,-105.2,243.914997385087,-0.431297792787676
"908597188","02-01-2020 12:29",918.8,411.190716247589,787.325,353.991336088387,-131.475,386.919556083363,-0.339799314697015 "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 "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 "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 "920781648","02-03-2020 14:14",802.925,265.786147648916,1075.9,355.64140683617,272.975,340.84978293277,0.800865993374689
"941148583","02-10-2020 13:57",1601.41176470588,584.25223473838,1068.61538461538,356.285930072479,-532.796380090498,543.198334981185,-0.980850539810569
"945011642","02-01-2020 18:49",835.85,320.558211042342,1100.575,554.992487244139,264.725,469.605023741,0.563718415725474 "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 "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
...@@ -91,7 +91,7 @@ data %>% ...@@ -91,7 +91,7 @@ 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", alldata <- read.table("data/alldata-expe-lem.csv",
sep=",", sep=",",
dec= ".", dec= ".",
header = T) %>% header = T) %>%
...@@ -100,7 +100,7 @@ alldata <- read.table("alldata-expe-lem.csv", ...@@ -100,7 +100,7 @@ alldata <- read.table("alldata-expe-lem.csv",
iat_scores <- alldata %>% iat_scores <- alldata %>%
filter(reactionTime < 3000) %>% filter(reactionTime < 3000) %>%
filter(reactionTime > 300) %>% filter(reactionTime > 300) %>%
filter(trial == 4 | (trial ==6)) %>% filter(trial == 4 | (trial == 7)) %>%
group_by(id) %>% group_by(id) %>%
mutate(full.sd = sd(reactionTime)) %>% mutate(full.sd = sd(reactionTime)) %>%
group_by(id, trial, full.sd) %>% group_by(id, trial, full.sd) %>%
...@@ -108,12 +108,25 @@ iat_scores <- alldata %>% ...@@ -108,12 +108,25 @@ iat_scores <- alldata %>%
gather(variable,value, -id, -full.sd, -trial) %>% gather(variable,value, -id, -full.sd, -trial) %>%
unite(block, trial, variable) %>% unite(block, trial, variable) %>%
spread(block,value, sep = "") %>% spread(block,value, sep = "") %>%
mutate(d = round((block6_mRT - block4_mRT) / full.sd, digits=5)) mutate(d = round((block7_mRT - block4_mRT) / full.sd, digits=5))
iat_scores_train <- alldata %>%
filter(reactionTime < 3000) %>%
filter(reactionTime > 300) %>%
filter(trial == 3 | (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 - block3_mRT) / full.sd, digits=5))
alldata %>% alldata %>%
filter(reactionTime < 3000) %>% filter(reactionTime < 3000) %>%
filter(reactionTime > 300) %>% filter(reactionTime > 300) %>%
filter(trial == 4 | (trial ==6)) %>% filter(trial == 4 | (trial ==7)) %>%
mutate(category = recode_factor(category, mutate(category = recode_factor(category,
"A"= "Appropriation", "A"= "Appropriation",
"P"= "Partage", "P"= "Partage",
...@@ -121,7 +134,7 @@ alldata %>% ...@@ -121,7 +134,7 @@ alldata %>%
"2"= "PasMoi")) %>% "2"= "PasMoi")) %>%
mutate(trial=as.factor(trial)) %>% mutate(trial=as.factor(trial)) %>%
left_join(iat_scores, by='id') %>% left_join(iat_scores, by='id') %>%
mutate(lab = paste0("id: ", as.numeric(as.factor(id)),"(d=",d,")")) %>% mutate(lab = paste0("id: ", id,"\n(d=",d,")")) %>%
ggplot() + ggplot() +
geom_histogram(aes(x= reactionTime, fill=trial), position = "dodge") + geom_histogram(aes(x= reactionTime, fill=trial), position = "dodge") +
facet_wrap(~lab, scales ="free_x") + facet_wrap(~lab, scales ="free_x") +
...@@ -131,15 +144,76 @@ alldata %>% ...@@ -131,15 +144,76 @@ alldata %>%
units = "cm") units = "cm")
iat_scores %>% iat_scores %>%
arrange(d) %>% mutate(lab = (as.factor(id))) %>%
mutate(lab = paste0(as.numeric(as.factor(id)))) %>%
ggplot() + ggplot() +
geom_bar(aes(x=lab, y=d), stat="identity") + geom_bar(aes(x=reorder(lab,d), y=d), stat="identity") +
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust=0.5)) +
xlab("id") +
ggsave("scores-alldata.pdf", ggsave("scores-alldata.pdf",
height = 21 / 2, height = 21 / 2,
width = 29.7 /2, width = 29.7 /2,
units = "cm") units = "cm")
iat_scores %>%
select(id, d) %>%
mutate(session = "Test") %>%
union(iat_scores_train %>%
select(id, d) %>%
mutate(session = "Training")) %>%
group_by(id) %>%
mutate(order = mean(d)) %>%
mutate(lab = (as.factor(id))) %>%
ggplot() +
geom_bar(aes(x=reorder(lab,order), y=d, fill=session), stat="identity", position = "dodge") +
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust=0.5)) +
xlab("id") +
ggsave("scores-alldata-ntrain.pdf",
height = 21 / 2,
width = 29.7 /2,
units = "cm")
iat_scores %>%
select(id, d) %>%
mutate(session = "Test") %>%
union(iat_scores_train %>%
select(id, d) %>%
mutate(session = "Training")) %>%
ggplot() +
geom_density(aes(x=d, color = session), bins = 15, bw=0.1) +
ggsave("scores-density-alldata-n-train.pdf",
height = 21 / 2,
width = 29.7 /2,
units = "cm")
iat_scores %>%
select(id, d) %>%
mutate(session = "Test") %>%
union(iat_scores_train %>%
select(id, d) %>%
mutate(session = "Training")) %>%
ggplot() +
geom_histogram(aes(x=d, fill = session), position="dodge", bins = 15, bw=0.1) +
ggsave("scores-histo-alldata-n-train.pdf",
height = 21 / 2,
width = 29.7 /2,
units = "cm")
iat_scores %>%
ggplot() +
geom_density(aes(d), bins = 15, bw=0.1) +
ggsave("scores-density-alldata.pdf",
height = 21 / 2,
width = 29.7 /2,
units = "cm")
iat_scores %>%
ggplot() +
geom_histogram(aes(d), bins = 15, bw=0.1) +
ggsave("scores-histo-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",
......
...@@ -79,7 +79,8 @@ for(i in 1:length(data.list)) ...@@ -79,7 +79,8 @@ for(i in 1:length(data.list))
alldata <- alldata %>% alldata <- alldata %>%
rbind(dat) rbind(dat)
} }
alldata %>% alldata <- alldata %>%
mutate(trial = trial + 1) %>%
tbl_df() tbl_df()
setwd(paste(base.dir,"data",sep="")) setwd(paste(base.dir,"data",sep=""))
......
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