articleID <- 6-7-2014 # insert the article ID code here e.g., "10-3-2015"
reportType <- 'pilot' # specify whether this is the 'pilot' report or 'copilot' report
pilotNames <- 'Effie Li' # insert the pilot's name here e.g., "Tom Hardwicke".
copilotNames <- 'Ayo Dada' # # insert the co-pilot's name here e.g., "Michael Frank".
pilotTTC <- 180 # 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 <- '11/09/19' # 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 <- NA # insert the date of final report completion in US format e.g., as.Date("01/25/18", format = "%m/%d/%y")
This study recruited participants from either the eastbound platform or the westbound platform of the Bay Street station in Toronto. Participants each rated how far one of the four stations – (from west to east) Spadina station, the St. George station, the Bloor-Yonge station, or the Sherbourne station – felt using a scale from 1 to 7.
We carried out a 2 (orientation: toward, away from) × 4 (station: Spadina, St. George, Bloor-Yonge, Sherbourne) analysis of variance (ANOVA) on closeness ratings, which revealed no main effect of orientation, F < 1, and a main effect of station, F(3, 194) = 24.10, p < .001, ηp2 = .27. This main effect was qualified by the predicted interaction between orientation and station, F(3, 194) = 16.28, p < .001, ηp2 = .20. We decomposed this interaction by the subjective-distance ratings between participants traveling east and west for each of the four subway stations. Westbound participants rated the stations to the west of Bay Street as closer than did eastbound participants; this effect was obtained for both the station one stop to the west (St. George, p < .001, ηp2 = .28) and the station two stops to the west (Spadina, p = .001, ηp2 = .20). The opposite pattern held true for stations to the east of Bay Street. Eastbound participants rated the stations to the east of Bay Street as closer than did westbound participants; this effect was obtained for both the station one stop to the east (Bloor-Yonge, p = .053, ηp2 = .08) and the station two stops to the east (Sherbourne, p < .001, ηp2 = .24). Figure 1 summarizes these results. comparing
# 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
library(lsr)
# 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)
data = read_excel('GroupB_6-7-2014/data/S1_Subway.xlsx')
This dataset was already in the tidy form.
The original paper did not specify any necessary pre-processing steps.
The targeted outcomes do not include descriptive statistics. To help interpret the anova results below, we provide the means and standard deviations of both groups of participants’ ratings of distance per station.
data %>%
group_by(DIRECTION, STN_NAME) %>%
summarize(meanDISTANCE=mean(DISTANCE), stdDISTANCE=sd(DISTANCE))
## # A tibble: 8 x 4
## # Groups: DIRECTION [2]
## DIRECTION STN_NAME meanDISTANCE stdDISTANCE
## <chr> <chr> <dbl> <dbl>
## 1 EAST B-Y 1.61 0.722
## 2 EAST SHER 2.77 1.14
## 3 EAST SPAD 3.65 1.09
## 4 EAST STG 2.77 1.03
## 5 WEST B-Y 2.19 1.23
## 6 WEST SHER 4 1.12
## 7 WEST SPAD 2.64 0.995
## 8 WEST STG 1.64 0.810
“We carried out a 2 (orientation: toward, away from) × 4 (station: Spadina, St. George, Bloor-Yonge, Sherbourne) analysis of variance (ANOVA) on closeness ratings, which revealed no main effect of orientation, F < 1, and a main effect of station, F(3, 194) = 24.10, p < .001, ηp2 = .27. This main effect was qualified by the predicted interaction between orientation and station, F(3, 194) = 16.28, p < .001, ηp2 = .20.”
# run two-way ANOVA
fit = aov(DISTANCE ~ DIRECTION*STN_NAME, data = data)
summary(fit)
## Df Sum Sq Mean Sq F value Pr(>F)
## DIRECTION 1 0.71 0.713 0.664 0.416
## STN_NAME 3 75.16 25.053 23.349 6.01e-13 ***
## DIRECTION:STN_NAME 3 52.41 17.471 16.283 1.77e-09 ***
## Residuals 194 208.15 1.073
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(fit)
## eta.sq eta.sq.part
## DIRECTION 0.001195964 0.001929304
## STN_NAME 0.223393543 0.265284110
## DIRECTION:STN_NAME 0.155789423 0.201151614
# check values (in the order of presentation in the quote above)
# no main effect of orientation (DIRECTION)
reportObject <- reproCheck(reportedValue = '<1', obtainedValue = '0.664', valueType = 'F', eyeballCheck = TRUE)
## [1] "MATCH for F. Eyeball comparison only."
# main effect of station (STN_NAME)
reportObject <- reproCheck(reportedValue = '3', obtainedValue = '3', valueType = 'df')
## [1] "MATCH for df. The reported value (3) and the obtained value (3) differed by 0%. Note that the obtained value was rounded to 0 decimal places to match the reported value."
reportObject <- reproCheck(reportedValue = '194', obtainedValue = '194', valueType = 'df')
## [1] "MATCH for df. The reported value (194) and the obtained value (194) differed by 0%. Note that the obtained value was rounded to 0 decimal places to match the reported value."
reportObject <- reproCheck(reportedValue = '24.10', obtainedValue = '23.349', valueType = 'F')
## [1] "MINOR_ERROR for F. The reported value (24.1) and the obtained value (23.35) differed by 3.11%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
reportObject <- reproCheck(reportedValue = '<.001', obtainedValue = '6.01e-13', valueType = 'p', eyeballCheck = TRUE)
## [1] "MATCH for p. Eyeball comparison only."
reportObject <- reproCheck(reportedValue = '.27', obtainedValue = '0.265284110', valueType = 'pes')
## [1] "MATCH for pes. The reported value (0.27) and the obtained value (0.27) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
# interaction
reportObject <- reproCheck(reportedValue = '16.28', obtainedValue = '16.283', valueType = 'F')
## [1] "MATCH for F. The reported value (16.28) and the obtained value (16.28) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
reportObject <- reproCheck(reportedValue = '<.001', obtainedValue = '1.77e-09', valueType = 'p', eyeballCheck = TRUE)
## [1] "MATCH for p. Eyeball comparison only."
reportObject <- reproCheck(reportedValue = '.20', obtainedValue = '0.201151614', valueType = 'pes')
## [1] "MATCH for pes. The reported value (0.2) and the obtained value (0.2) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
“We decomposed this interaction by the subjective-distance ratings between participants traveling east and west for each of the four subway stations.”
# split data based on subway stations
BY = data %>% filter(STN_NAME=='B-Y')
sher = data %>% filter(STN_NAME=='SHER')
spad = data %>% filter(STN_NAME=='SPAD')
stg = data %>% filter(STN_NAME=='STG')
“Westbound participants rated the stations to the west of Bay Street as closer than did eastbound participants; this effect was obtained for both the station one stop to the west (St. George, p < .001, ηp2 = .28)…”
St. George:
fit_stg = aov(DISTANCE ~ DIRECTION, data = stg)
summary(fit_stg)
## Df Sum Sq Mean Sq F value Pr(>F)
## DIRECTION 1 16.25 16.252 18.79 7.23e-05 ***
## Residuals 49 42.38 0.865
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(fit_stg)
## eta.sq eta.sq.part
## DIRECTION 0.2772092 0.2772092
# check values (in the order of presentation in the quote above)
reportObject <- reproCheck(reportedValue = '<.001', obtainedValue = '7.23e-05', valueType = 'p', eyeballCheck = TRUE)
## [1] "MATCH for p. Eyeball comparison only."
reportObject <- reproCheck(reportedValue = '.28', obtainedValue = '0.2772092', valueType = 'pes')
## [1] "MATCH for pes. The reported value (0.28) and the obtained value (0.28) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
“…and the station two stops to the west (Spadina, p = .001, ηp2 = .20).”
Spadina:
fit_spad = aov(DISTANCE ~ DIRECTION, data = spad)
summary(fit_spad)
## Df Sum Sq Mean Sq F value Pr(>F)
## DIRECTION 1 13.10 13.100 11.97 0.00113 **
## Residuals 49 53.64 1.095
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(fit_spad)
## eta.sq eta.sq.part
## DIRECTION 0.1962763 0.1962763
# check values (in the order of presentation in the quote above)
reportObject <- reproCheck(reportedValue = '.001', obtainedValue = '0.00113', valueType = 'p')
## [1] "MATCH for p. The reported value (0.001) and the obtained value (0.001) differed by 0%. Note that the obtained value was rounded to 3 decimal places to match the reported value."
reportObject <- reproCheck(reportedValue = '.20', obtainedValue = '0.1962763', valueType = 'pes')
## [1] "MATCH for pes. The reported value (0.2) and the obtained value (0.2) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
“The opposite pattern held true for stations to the east of Bay Street. Eastbound participants rated the stations to the east of Bay Street as closer than did westbound participants; this effect was obtained for both the station one stop to the east (Bloor-Yonge, p = .053, ηp2 = .08)…”
Bloor-Yonge:
fit_by = aov(DISTANCE ~ DIRECTION, data = BY)
summary(fit_by)
## Df Sum Sq Mean Sq F value Pr(>F)
## DIRECTION 1 4.16 4.157 3.945 0.0528 .
## Residuals 47 49.52 1.054
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(fit_by)
## eta.sq eta.sq.part
## DIRECTION 0.0774451 0.0774451
# check values (in the order of presentation in the quote above)
reportObject <- reproCheck(reportedValue = '.053', obtainedValue = '0.0528', valueType = 'p')
## [1] "MATCH for p. The reported value (0.053) and the obtained value (0.053) differed by 0%. Note that the obtained value was rounded to 3 decimal places to match the reported value."
reportObject <- reproCheck(reportedValue = '.08', obtainedValue = '0.0774451', valueType = 'pes')
## [1] "MATCH for pes. The reported value (0.08) and the obtained value (0.08) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
“…and the station two stops to the east (Sherbourne, p < .001, ηp2 = .24).”
Sherbourne:
fit_sher = aov(DISTANCE ~ DIRECTION, data = sher)
summary(fit_sher)
## Df Sum Sq Mean Sq F value Pr(>F)
## DIRECTION 1 19.31 19.306 15.11 0.000305 ***
## Residuals 49 62.62 1.278
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(fit_sher)
## eta.sq eta.sq.part
## DIRECTION 0.2356667 0.2356667
# check values (in the order of presentation in the quote above)
reportObject <- reproCheck(reportedValue = '<.001', obtainedValue = '0.000305', valueType = 'p', eyeballCheck = TRUE)
## [1] "MATCH for p. Eyeball comparison only."
reportObject <- reproCheck(reportedValue = '.24', obtainedValue = '0.2356667', valueType = 'pes')
## [1] "MATCH for pes. The reported value (0.24) and the obtained value (0.24) differed by 0%. Note that the obtained value was rounded to 2 decimal places to match the reported value."
This reproduction of the original analysis descrived in Study 1 was a success. All the values included in the target outcomes were replicated with matching values, except a minor difference (3% difference) of the F-statistic of the main effect of station in the two-way ANOVA.
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")
}
[This function will output information about the package versions used in this report:]
devtools::session_info()
## ─ Session info ──────────────────────────────────────────────────────────
## setting value
## version R version 3.6.0 (2019-04-26)
## os macOS Mojave 10.14.5
## 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.4 2019-04-10 [1]
## broom 0.5.2 2019-04-07 [1]
## callr 3.3.1 2019-07-18 [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.19 2019-05-20 [1]
## dplyr * 0.8.3 2019-07-04 [1]
## ellipsis 0.3.0 2019-09-20 [1]
## evaluate 0.14 2019-05-28 [1]
## fansi 0.4.0 2018-10-05 [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.1.1 2019-04-07 [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.1 2019-08-23 [1]
## htmltools 0.3.6 2017-04-28 [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]
## lsr * 0.5 2015-03-02 [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-139 2019-04-09 [1]
## pillar 1.4.1 2019-05-28 [1]
## pkgbuild 1.0.6 2019-10-09 [1]
## pkgconfig 2.0.2 2018-08-16 [1]
## pkgload 1.0.2 2018-10-29 [1]
## plyr 1.8.4 2016-06-08 [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.2 2019-03-15 [1]
## R6 2.4.0 2019-02-14 [1]
## Rcpp 1.0.1 2019-03-17 [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-09 [1]
## rlang 0.4.1 2019-10-24 [1]
## rmarkdown 1.15 2019-08-21 [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.3.0 2019-11-05 [1]
## tibble * 2.1.2 2019-05-29 [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]
## utf8 1.1.4 2018-05-24 [1]
## vctrs 0.2.0 2019-07-05 [1]
## withr 2.1.2 2018-03-15 [1]
## xfun 0.9 2019-08-21 [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.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.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.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)
## CRAN (R 3.6.0)
##
## [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library