articleID <- 9-2-2015 # insert the article ID code here e.g., "10-3-2015"
reportType <- 'pilot' # specify whether this is the 'pilot' report or 'copilot' report
pilotNames <- "Justin Yuan" # insert the pilot's name here e.g., "Tom Hardwicke".
copilotNames <- NA # # insert the co-pilot's name here e.g., "Michael Frank".
pilotTTC <- 300 # insert the pilot's estimated time to complete (in minutes, it is fine to approximate) e.g., 120
copilotTTC <- NA # insert the co-pilot's estimated time to complete (in minutes, it is fine to approximate) e.g., 120
pilotStartDate <- as.Date("11/08/19", format = "%m/%d/%y") # insert the piloting start date in US format e.g., as.Date("01/25/18", format = "%m/%d/%y")
copilotStartDate <- NA # insert the co-piloting start date in US format e.g., as.Date("01/25/18", format = "%m/%d/%y")
completionDate <- as.Date("11/09/19", format = "%m/%d/%y") # insert the date of final report completion in US format e.g., as.Date("01/25/18", format = "%m/%d/%y")
Subjects were shown a stimulus array consisting of a target stimulus (a letter) and three distracting numbers. All stimuli were randomly assigned a different color (red, blue, yellow, or magenta). The stimulus array was then masked using “@” symbols, and then the screen turned blank (dark grey).
The Presurprise trial consisted of a location task, where the screen showed the numbers 1, 2, 3, and 4, located at the positions of the original 4 stimuli. Subjects were asked to indicate which position the letter stimulus was located at. There were 155 Presurprise trials
In the Surprise trial, the subjects were asked to identify the critical attribute of the stimulus (the identity of the letter) and also a task-irrelevant attribute of the target (the letter’s color). The Surprise trial started on Trial #156, and was followed by 4 Control trials.
The percentage of correct responses was the measure of interest.
# load packages
library(tidyverse) # for data munging
library(knitr) # for kable table formating
library(haven) # import and export 'SPSS', 'Stata' and 'SAS' Files
library(readxl) # import excel files
library(ReproReports) # custom reporting functions
# Prepare report object. This will be updated automatically by the reproCheck function each time values are compared
reportObject <- data.frame(dummyRow = TRUE, reportedValue = NA, obtainedValue = NA, valueType = NA, percentageError = NA, comparisonOutcome = NA, eyeballCheck = NA)
d <- read.csv("GroupD_9-2-2015/data/materials-9859-Top-level_materials/12022-Exp1.csv", sep = ",")
head(d)
## X6 X1 X1.1 X1.2 X3 X3.1 X0 X0.1 X1.3 X0.2 X0.3 X0.4
## 1 6 1 2 1 2 4 0 0 2 0 0 0
## 2 6 1 3 3 4 3 0 0 3 0 0 1
## 3 6 1 4 1 3 1 0 0 1 0 0 1
## 4 6 1 5 3 1 4 0 0 4 0 0 1
## 5 6 1 6 2 2 1 0 0 1 0 0 1
## 6 6 1 7 2 1 3 0 0 3 0 0 1
colnames(d)= c("id", "block", "trial", "color_target", "identity_target", "location_target", "color_response", "identity_response", "location_response", "acc_color_report", "acc_identity_report", "acc_location_report")
#making a dataset consisting of just the accuracy data
acc_d <- d%>%
select(id, block, trial,
contains("acc"))
head(acc_d)
## id block trial acc_color_report acc_identity_report acc_location_report
## 1 6 1 2 0 0 0
## 2 6 1 3 0 0 1
## 3 6 1 4 0 0 1
## 4 6 1 5 0 0 1
## 5 6 1 6 0 0 1
## 6 6 1 7 0 0 1
pre <- acc_d %>%
filter(trial <= 155)
#On the presurprise trials, 89% of responses in the location task were correct
presurprise <- sum(pre$acc_location_report==1) / length(pre$id)
reportObject <- reproCheck(reportedValue = '0.89', obtainedValue = presurprise, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.89) and the obtained value (0.89) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
#create dataset for only surprise trial data
surprise_data <- acc_d %>%
filter(trial == 156)
#surprise color task performance
#"Only 6 of 20 (30%) participants correctly reported the ...."
color <- sum(surprise_data$acc_color_report == 1)
color/20
## [1] 0.3
surpriseColorCheck <- reproCheck(reportedValue = '0.3', obtainedValue = color/20, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.3) and the obtained value (0.3) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#surprise identity taks performance
#"Furthermore, performance on the identity task (25% correct)..."
identity <- sum(surprise_data$acc_identity_report == 1)
identity/20
## [1] 0.25
surpriseIdentityCheck <- reproCheck(reportedValue = '0.25', obtainedValue = identity/20, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.25) and the obtained value (0.25) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
#surprise location task
#"Moreover, in the surprise trial, participants’ performance on the location task, unlike their performance on the color and identity tasks, was good (80% correct)"
location <- sum(surprise_data$acc_location_report == 1)
location/20
## [1] 0.8
surpriseLocationCheck <- reproCheck(reportedValue = '0.8', obtainedValue = location/20, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.8) and the obtained value (0.8) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#Participants exhibited a dramatic increase in reporting accuracy for the target letter’s color (70% correct) and identity (75% correct) on the first control trial (i.e., the trial immediately after the surprise trial).
ctrl = acc_d %>%
filter(trial == 157)
#color task
ctrl1_color <- sum(ctrl$acc_color_report == 1) / 20
ctrl1_colorCheck <- reproCheck(reportedValue = '0.7', obtainedValue = ctrl1_color, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.7) and the obtained value (0.7) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#identity task
ctrl1_identity <- sum(ctrl$acc_identity_report == 1) / 20
ctrl1_identityCheck <- reproCheck(reportedValue = '0.75', obtainedValue = ctrl1_identity, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.75) and the obtained value (0.75) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
#location task
ctrl1_location <- sum(ctrl$acc_location_report == 1) / 20
ctrl1_locationCheck <- reproCheck(reportedValue = '0.8', obtainedValue = ctrl1_location, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.8) and the obtained value (0.8) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
ctrl2 = acc_d %>%
filter(trial == 158)
#color task
ctrl2_color <- sum(ctrl2$acc_color_report == 1) / 20
ctrl2_colorCheck <- reproCheck(reportedValue = '0.75', obtainedValue = ctrl2_color, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.75) and the obtained value (0.75) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
#identity task
ctrl2_identity <- sum(ctrl2$acc_identity_report == 1) / 20
ctrl2_identityCheck <- reproCheck(reportedValue = '0.75', obtainedValue = ctrl2_identity, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.75) and the obtained value (0.75) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
#location task
ctrl2_location <- sum(ctrl2$acc_location_report == 1) / 20
ctrl2_locationCheck <- reproCheck(reportedValue = '0.85', obtainedValue = ctrl2_location, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.85) and the obtained value (0.85) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
ctrl3 = acc_d %>%
filter(trial == 159)
#color task
ctrl3_color <- sum(ctrl3$acc_color_report == 1) / 20
ctrl3_colorCheck <- reproCheck(reportedValue = '0.7', obtainedValue = ctrl3_color, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.7) and the obtained value (0.7) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#identity task
ctrl3_identity <- sum(ctrl3$acc_identity_report == 1) / 20
ctrl3_identityCheck <- reproCheck(reportedValue = '0.8', obtainedValue = ctrl3_identity, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.8) and the obtained value (0.8) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#location task
ctrl3_location <- sum(ctrl3$acc_location_report == 1) / 20
ctrl3_locationCheck <- reproCheck(reportedValue = '0.8', obtainedValue = ctrl3_location, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.8) and the obtained value (0.8) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
ctrl4 = acc_d %>%
filter(trial == 160)
#color task
ctrl4_color <- sum(ctrl4$acc_color_report == 1) / 20
ctrl4_colorCheck <- reproCheck(reportedValue = '0.8', obtainedValue = ctrl4_color, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.8) and the obtained value (0.8) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#identity task
ctrl4_identity <- sum(ctrl4$acc_identity_report == 1) / 20
ctrl4_identityCheck <- reproCheck(reportedValue = '0.75', obtainedValue = ctrl4_identity, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.75) and the obtained value (0.75) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
#location task
ctrl4_location <- sum(ctrl4$acc_location_report == 1) / 20
ctrl4_locationCheck <- reproCheck(reportedValue = '0.7', obtainedValue = ctrl4_location, valueType = 'other', round = TRUE)
## [1] "MATCH for other. The reported value (0.7) and the obtained value (0.7) differed by 0%. Note that the obtained value was rounded to 1 decimal places to match the reported value."
#"The improvement in each case was significant—color: 70% versus 30%, χ2(1, N = 40) = 6.40, p = .011, ϕ = .40"
b = matrix(
c(ctrl1_color*20, 20-ctrl1_color*20,color,20-color),
nrow=2,
ncol=2)
chisq.test(b, correct = FALSE)
##
## Pearson's Chi-squared test
##
## data: b
## X-squared = 6.4, df = 1, p-value = 0.01141
b_value <- 0.01141 #this is the p-val
chiPvalCheck1 <- reproCheck(reportedValue = '0.011', obtainedValue = b_value, valueType = 'p', round = TRUE)
## [1] "MATCH for p. The reported value (0.011) and the obtained value (0.011) differed by 0%. Note that the obtained value was rounded to 3 decimal places to match the reported value."
#identity: 75% versus 25%, χ2(1, N = 40) = 10.00, p < .005, ϕ = .50. "
#identity chi square; 75% vs. 25%
c = matrix(
c(ctrl1_identity*20, 20-ctrl1_identity*20,identity,20-identity),
nrow=2,
ncol=2)
chisq.test(c, correct = FALSE)
##
## Pearson's Chi-squared test
##
## data: c
## X-squared = 10, df = 1, p-value = 0.001565
c_value <- 0.001565 #this is the p-val
chiPvalCheck2 <- reproCheck(reportedValue = '<0.005', obtainedValue = c_value, valueType = 'p', eyeballCheck = TRUE, round = TRUE)
## [1] "MATCH for p. Eyeball comparison only."
The reproducibility check for this paper was successful. The percentages of correct responses and the Chi-squared findings were reproduced.
reportObject <- reportObject %>%
filter(dummyRow == FALSE) %>% # remove the dummy row
select(-dummyRow) %>% # remove dummy row designation
mutate(articleID = articleID) %>% # add variables to report
select(articleID, everything()) # make articleID first column
# decide on final outcome
if(any(reportObject$comparisonOutcome %in% c("MAJOR_ERROR", "DECISION_ERROR"))){
finalOutcome <- "Failure"
}else{
finalOutcome <- "Success"
}
# collate report extra details
reportExtras <- data.frame(articleID, pilotNames, copilotNames, pilotTTC, copilotTTC, pilotStartDate, copilotStartDate, completionDate, finalOutcome)
# save report objects
if(reportType == "pilot"){
write_csv(reportObject, "pilotReportDetailed.csv")
write_csv(reportExtras, "pilotReportExtras.csv")
}
if(reportType == "copilot"){
write_csv(reportObject, "copilotReportDetailed.csv")
write_csv(reportExtras, "copilotReportExtras.csv")
}
devtools::session_info()
## ─ Session info ──────────────────────────────────────────────────────────
## setting value
## version R version 3.6.1 (2019-07-05)
## os macOS Catalina 10.15.1
## system x86_64, darwin15.6.0
## ui X11
## language (EN)
## collate en_US.UTF-8
## ctype en_US.UTF-8
## tz America/Los_Angeles
## date 2019-11-09
##
## ─ Packages ──────────────────────────────────────────────────────────────
## package * version date lib
## assertthat 0.2.1 2019-03-21 [1]
## backports 1.1.5 2019-10-02 [1]
## broom 0.5.2 2019-04-07 [1]
## callr 3.3.2 2019-09-22 [1]
## cellranger 1.1.0 2016-07-27 [1]
## cli 1.1.0 2019-03-19 [1]
## colorspace 1.4-1 2019-03-18 [1]
## crayon 1.3.4 2017-09-16 [1]
## desc 1.2.0 2018-05-01 [1]
## devtools 2.2.1 2019-09-24 [1]
## digest 0.6.22 2019-10-21 [1]
## dplyr * 0.8.3 2019-07-04 [1]
## ellipsis 0.3.0 2019-09-20 [1]
## evaluate 0.14 2019-05-28 [1]
## forcats * 0.4.0 2019-02-17 [1]
## fs 1.3.1 2019-05-06 [1]
## generics 0.0.2 2018-11-29 [1]
## ggplot2 * 3.2.1 2019-08-10 [1]
## glue 1.3.1 2019-03-12 [1]
## gtable 0.3.0 2019-03-25 [1]
## haven * 2.1.1 2019-07-04 [1]
## hms 0.5.2 2019-10-30 [1]
## htmltools 0.4.0 2019-10-04 [1]
## httr 1.4.1 2019-08-05 [1]
## jsonlite 1.6 2018-12-07 [1]
## knitr * 1.25 2019-09-18 [1]
## lattice 0.20-38 2018-11-04 [1]
## lazyeval 0.2.2 2019-03-15 [1]
## lifecycle 0.1.0 2019-08-01 [1]
## lubridate 1.7.4 2018-04-11 [1]
## magrittr 1.5 2014-11-22 [1]
## memoise 1.1.0 2017-04-21 [1]
## modelr 0.1.5 2019-08-08 [1]
## munsell 0.5.0 2018-06-12 [1]
## nlme 3.1-140 2019-05-12 [1]
## pillar 1.4.2 2019-06-29 [1]
## pkgbuild 1.0.6 2019-10-09 [1]
## pkgconfig 2.0.3 2019-09-22 [1]
## pkgload 1.0.2 2018-10-29 [1]
## prettyunits 1.0.2 2015-07-13 [1]
## processx 3.4.1 2019-07-18 [1]
## ps 1.3.0 2018-12-21 [1]
## purrr * 0.3.3 2019-10-18 [1]
## R6 2.4.0 2019-02-14 [1]
## Rcpp 1.0.2 2019-07-25 [1]
## readr * 1.3.1 2018-12-21 [1]
## readxl * 1.3.1 2019-03-13 [1]
## remotes 2.1.0 2019-06-24 [1]
## ReproReports * 0.1 2019-11-08 [1]
## rlang 0.4.1 2019-10-24 [1]
## rmarkdown 1.16 2019-10-01 [1]
## rprojroot 1.3-2 2018-01-03 [1]
## rstudioapi 0.10 2019-03-19 [1]
## rvest 0.3.4 2019-05-15 [1]
## scales 1.0.0 2018-08-09 [1]
## sessioninfo 1.1.1 2018-11-05 [1]
## stringi 1.4.3 2019-03-12 [1]
## stringr * 1.4.0 2019-02-10 [1]
## testthat 2.2.1 2019-07-25 [1]
## tibble * 2.1.3 2019-06-06 [1]
## tidyr * 1.0.0 2019-09-11 [1]
## tidyselect 0.2.5 2018-10-11 [1]
## tidyverse * 1.2.1 2017-11-14 [1]
## usethis 1.5.1 2019-07-04 [1]
## vctrs 0.2.0 2019-07-05 [1]
## withr 2.1.2 2018-03-15 [1]
## xfun 0.10 2019-10-01 [1]
## xml2 1.2.2 2019-08-09 [1]
## yaml 2.2.0 2018-07-25 [1]
## zeallot 0.1.0 2018-01-28 [1]
## source
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.1)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.1)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.1)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## Github (TomHardwicke/ReproReports@2ec6f60)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
## CRAN (R 3.6.0)
##
## [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library