Loading required R packages, setting working directory, and reading the data file.
require(psych)
require(BayesFactor)
setwd("/Users/ivanropovik/OneDrive/MANUSCRIPTS/2016 Many Labs 5/Pilot 1/Analyses/")
pilot1 <- read.csv(file = "Pilot_1_Coventry.csv", header = TRUE, sep = ";")
Computing means of the two scale items for each scenario. If one of the two target items is missing, the score of the other item is used as the estimate for the given scenario.
pilot1$scenario1_Q3 <- rowMeans(pilot1[,c("Q9", "Q12")], na.rm = TRUE)
pilot1$scenario2_Q15 <- rowMeans(pilot1[,c("Q20", "Q23")], na.rm = TRUE)
pilot1$scenario3_Q26 <- rowMeans(pilot1[,c("Q31", "Q34")], na.rm = TRUE)
pilot1$scenario4_Q239 <- rowMeans(pilot1[,c("Q244", "Q247")], na.rm = TRUE)
pilot1$scenario5_Q37 <- rowMeans(pilot1[,c("Q42", "Q45")], na.rm = TRUE)
pilot1$scenario6_Q250 <- rowMeans(pilot1[,c("Q255", "Q258")], na.rm = TRUE)
pilot1$scenario7_Q48 <- rowMeans(pilot1[,c("Q53", "Q56")], na.rm = TRUE)
pilot1$scenario8_Q59 <- rowMeans(pilot1[,c("Q64", "Q67")], na.rm = TRUE)
pilot1$scenario9_Q261 <- rowMeans(pilot1[,c("Q266", "Q269")], na.rm = TRUE)
pilot1$scenario10_Q81 <- rowMeans(pilot1[,c("Q86", "Q89")], na.rm = TRUE)
pilot1$scenario11_Q92 <- rowMeans(pilot1[,c("Q97", "Q100")], na.rm = TRUE)
pilot1$scenario12_Q103 <- rowMeans(pilot1[,c("Q108", "Q111")], na.rm = TRUE)
pilot1$scenario13_Q272 <- rowMeans(pilot1[,c("Q277", "Q280")], na.rm = TRUE)
pilot1$scenario14_Q283 <- rowMeans(pilot1[,c("Q288", "Q291")], na.rm = TRUE)
pilot1$scenario15_Q114 <- rowMeans(pilot1[,c("Q119", "Q122")], na.rm = TRUE)
pilot1$scenario16_Q228 <- rowMeans(pilot1[,c("Q233", "Q236")], na.rm = TRUE)
pilot1$scenario17_Q125 <- rowMeans(pilot1[,c("Q130", "Q133")], na.rm = TRUE)
pilot1$scenario18_Q136 <- rowMeans(pilot1[,c("Q141", "Q144")], na.rm = TRUE)
pilot1$scenario19_Q147 <- rowMeans(pilot1[,c("Q152", "Q155")], na.rm = TRUE)
pilot1$scenario20_Q158 <- rowMeans(pilot1[,c("Q163", "Q166")], na.rm = TRUE)
pilot1$scenario21_Q169 <- rowMeans(pilot1[,c("Q174", "Q177")], na.rm = TRUE)
nrow(pilot1)
## [1] 50
Q180 = Gender
Q181 = Year of study
Q182 = Age
lapply(pilot1[,c("Q180", "Q181", "Q182")],
function(x){table(x, useNA = "ifany")})
## $Q180
## x
## 1 2 <NA>
## 15 31 4
##
## $Q181
## x
## 1 2 3 4 5 <NA>
## 3 9 3 1 29 5
##
## $Q182
## x
## 19 20 21 22 23 24 25 26 27 30 31 32 33 36 37
## 2 2 3 7 2 3 2 5 4 1 2 2 1 1 2
## 38 44 49 53 <NA>
## 4 1 1 1 4
lapply(pilot1[,c("scenario1_Q3", "scenario2_Q15", "scenario3_Q26", "scenario4_Q239", "scenario5_Q37",
"scenario6_Q250", "scenario7_Q48", "scenario8_Q59", "scenario9_Q261",
"scenario10_Q81", "scenario11_Q92", "scenario12_Q103", "scenario13_Q272",
"scenario14_Q283", "scenario15_Q114", "scenario16_Q228", "scenario17_Q125",
"scenario18_Q136", "scenario19_Q147", "scenario20_Q158", "scenario21_Q169")],
function(x){describe(x, na.rm = TRUE, fast = TRUE)})
## $scenario1_Q3
## vars n mean sd min max range se
## X1 1 48 5.2 1.84 1 8 7 0.26
##
## $scenario2_Q15
## vars n mean sd min max range se
## X1 1 49 6.18 1.78 1 9 8 0.25
##
## $scenario3_Q26
## vars n mean sd min max range se
## X1 1 49 3.58 1.6 1 7.5 6.5 0.23
##
## $scenario4_Q239
## vars n mean sd min max range se
## X1 1 48 4.95 1.95 1 8.5 7.5 0.28
##
## $scenario5_Q37
## vars n mean sd min max range se
## X1 1 48 5.69 1.89 1 8.5 7.5 0.27
##
## $scenario6_Q250
## vars n mean sd min max range se
## X1 1 48 6.64 1.78 1 9 8 0.26
##
## $scenario7_Q48
## vars n mean sd min max range se
## X1 1 48 5.56 1.2 2.5 9 6.5 0.17
##
## $scenario8_Q59
## vars n mean sd min max range se
## X1 1 47 7.55 1.23 5 9 4 0.18
##
## $scenario9_Q261
## vars n mean sd min max range se
## X1 1 47 6.5 1.89 2.5 9 6.5 0.28
##
## $scenario10_Q81
## vars n mean sd min max range se
## X1 1 47 5.81 1.57 2 9 7 0.23
##
## $scenario11_Q92
## vars n mean sd min max range se
## X1 1 47 5.91 1.83 1 8 7 0.27
##
## $scenario12_Q103
## vars n mean sd min max range se
## X1 1 47 5.65 1.56 2.5 9 6.5 0.23
##
## $scenario13_Q272
## vars n mean sd min max range se
## X1 1 47 5 1.7 1 9 8 0.25
##
## $scenario14_Q283
## vars n mean sd min max range se
## X1 1 47 5.95 1.5 3 9 6 0.22
##
## $scenario15_Q114
## vars n mean sd min max range se
## X1 1 47 3.93 1.23 1 7 6 0.18
##
## $scenario16_Q228
## vars n mean sd min max range se
## X1 1 47 6.22 1.28 3.5 9 5.5 0.19
##
## $scenario17_Q125
## vars n mean sd min max range se
## X1 1 47 6.28 1.61 2 9 7 0.23
##
## $scenario18_Q136
## vars n mean sd min max range se
## X1 1 47 3.52 2.09 1 8 7 0.3
##
## $scenario19_Q147
## vars n mean sd min max range se
## X1 1 47 3.7 1.8 1 9 8 0.26
##
## $scenario20_Q158
## vars n mean sd min max range se
## X1 1 47 4.64 1.61 1 8 7 0.23
##
## $scenario21_Q169
## vars n mean sd min max range se
## X1 1 47 6.28 1.62 1.5 9 7.5 0.24
One-sample t-test for each scenario with population parameter mu set at 5.
lapply(pilot1[,c("scenario1_Q3", "scenario2_Q15", "scenario3_Q26", "scenario4_Q239", "scenario5_Q37",
"scenario6_Q250", "scenario7_Q48", "scenario8_Q59", "scenario9_Q261",
"scenario10_Q81", "scenario11_Q92", "scenario12_Q103", "scenario13_Q272",
"scenario14_Q283", "scenario15_Q114", "scenario16_Q228", "scenario17_Q125",
"scenario18_Q136", "scenario19_Q147", "scenario20_Q158", "scenario21_Q169")],
function(x){t.test(x, data = pilot1, mu = 5, na.rm = TRUE)})
## $scenario1_Q3
##
## One Sample t-test
##
## data: x
## t = 0.74699, df = 47, p-value = 0.4588
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 4.664903 5.730931
## sample estimates:
## mean of x
## 5.197917
##
##
## $scenario2_Q15
##
## One Sample t-test
##
## data: x
## t = 4.6585, df = 48, p-value = 2.552e-05
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.672795 6.694552
## sample estimates:
## mean of x
## 6.183673
##
##
## $scenario3_Q26
##
## One Sample t-test
##
## data: x
## t = -6.2233, df = 48, p-value = 1.142e-07
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 3.123382 4.039883
## sample estimates:
## mean of x
## 3.581633
##
##
## $scenario4_Q239
##
## One Sample t-test
##
## data: x
## t = -0.18458, df = 47, p-value = 0.8544
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 4.380268 5.515565
## sample estimates:
## mean of x
## 4.947917
##
##
## $scenario5_Q37
##
## One Sample t-test
##
## data: x
## t = 2.517, df = 47, p-value = 0.01531
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.138009 6.236991
## sample estimates:
## mean of x
## 5.6875
##
##
## $scenario6_Q250
##
## One Sample t-test
##
## data: x
## t = 6.3664, df = 47, p-value = 7.49e-08
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 6.118637 7.152197
## sample estimates:
## mean of x
## 6.635417
##
##
## $scenario7_Q48
##
## One Sample t-test
##
## data: x
## t = 3.2564, df = 47, p-value = 0.002097
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.215004 5.909996
## sample estimates:
## mean of x
## 5.5625
##
##
## $scenario8_Q59
##
## One Sample t-test
##
## data: x
## t = 14.177, df = 46, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 7.190694 7.915689
## sample estimates:
## mean of x
## 7.553191
##
##
## $scenario9_Q261
##
## One Sample t-test
##
## data: x
## t = 5.4297, df = 46, p-value = 2.052e-06
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.943922 7.056078
## sample estimates:
## mean of x
## 6.5
##
##
## $scenario10_Q81
##
## One Sample t-test
##
## data: x
## t = 3.5244, df = 46, p-value = 0.0009724
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.346747 6.270274
## sample estimates:
## mean of x
## 5.808511
##
##
## $scenario11_Q92
##
## One Sample t-test
##
## data: x
## t = 3.4318, df = 46, p-value = 0.001278
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.378266 6.451521
## sample estimates:
## mean of x
## 5.914894
##
##
## $scenario12_Q103
##
## One Sample t-test
##
## data: x
## t = 2.8517, df = 46, p-value = 0.006492
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.190879 6.106994
## sample estimates:
## mean of x
## 5.648936
##
##
## $scenario13_Q272
##
## One Sample t-test
##
## data: x
## t = 0, df = 46, p-value = 1
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 4.501688 5.498312
## sample estimates:
## mean of x
## 5
##
##
## $scenario14_Q283
##
## One Sample t-test
##
## data: x
## t = 4.3354, df = 46, p-value = 7.851e-05
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.507208 6.386409
## sample estimates:
## mean of x
## 5.946809
##
##
## $scenario15_Q114
##
## One Sample t-test
##
## data: x
## t = -5.9718, df = 46, p-value = 3.192e-07
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 3.563364 4.287699
## sample estimates:
## mean of x
## 3.925532
##
##
## $scenario16_Q228
##
## One Sample t-test
##
## data: x
## t = 6.5293, df = 46, p-value = 4.643e-08
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.846244 6.600565
## sample estimates:
## mean of x
## 6.223404
##
##
## $scenario17_Q125
##
## One Sample t-test
##
## data: x
## t = 5.4436, df = 46, p-value = 1.958e-06
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.804541 6.748650
## sample estimates:
## mean of x
## 6.276596
##
##
## $scenario18_Q136
##
## One Sample t-test
##
## data: x
## t = -4.85, df = 46, p-value = 1.452e-05
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 2.907559 4.134994
## sample estimates:
## mean of x
## 3.521277
##
##
## $scenario19_Q147
##
## One Sample t-test
##
## data: x
## t = -4.9384, df = 46, p-value = 1.081e-05
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 3.173114 4.231141
## sample estimates:
## mean of x
## 3.702128
##
##
## $scenario20_Q158
##
## One Sample t-test
##
## data: x
## t = -1.5395, df = 46, p-value = 0.1305
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 4.165357 5.111238
## sample estimates:
## mean of x
## 4.638298
##
##
## $scenario21_Q169
##
## One Sample t-test
##
## data: x
## t = 5.3872, df = 46, p-value = 2.372e-06
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 5.799605 6.753587
## sample estimates:
## mean of x
## 6.276596
Bayes factor in favour of the null (BF01) for each scenario with population parameter mu set at 5 and prior width of 0.5.
lapply(pilot1[,c("scenario1_Q3", "scenario2_Q15", "scenario3_Q26", "scenario4_Q239", "scenario5_Q37",
"scenario6_Q250", "scenario7_Q48", "scenario8_Q59", "scenario9_Q261",
"scenario10_Q81", "scenario11_Q92", "scenario12_Q103", "scenario13_Q272",
"scenario14_Q283", "scenario15_Q114", "scenario16_Q228", "scenario17_Q125",
"scenario18_Q136", "scenario19_Q147", "scenario20_Q158", "scenario21_Q169")],
function(x){1/ttestBF(x[!is.na(x)], mu = 5, rscale = 0.5, na.rm = TRUE)})
## $scenario1_Q3
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 3.632535 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario2_Q15
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.001246355 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario3_Q26
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 8.826111e-06 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario4_Q239
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 4.588653 ±0.04%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario5_Q37
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.3163677 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario6_Q250
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 5.971296e-06 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario7_Q48
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.06016318 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario8_Q59
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 5.287953e-16 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario9_Q261
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.0001263968 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario10_Q81
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.03097626 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario11_Q92
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.03919864 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario12_Q103
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.155397 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario13_Q272
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 4.616444 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario14_Q283
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.003398486 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario15_Q114
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 2.287042e-05 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario16_Q228
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 3.832629e-06 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario17_Q125
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.0001210573 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario18_Q136
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.0007478762 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario19_Q147
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.0005727248 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario20_Q158
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 1.634552 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS
##
##
## $scenario21_Q169
## Bayes factor analysis
## --------------
## [1] Null, mu=5 : 0.0001442877 ±0%
##
## Against denominator:
## Alternative, r = 0.5, mu =/= 5
## ---
## Bayes factor type: BFoneSample, JZS