-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_statement.Rmd
180 lines (152 loc) · 7.96 KB
/
generate_statement.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
---
output: word_document
params:
ms_id: NA
ms_title: NA
ms_author: NA
Q2: NA
Q2a: NA
Q2b_eval: NA
Q2b_input: NA
Q2b_complete: NA
Q2b_partial: NA
Q2b_none: NA
Q2c_input: NA
S2_output: NA
Q3: NA
Q3a: NA
Q3b_eval: NA
Q3b_input: NA
Q3b_complete: NA
Q3b_partial: NA
Q3b_none: NA
Q3c_input: NA
S3_output: NA
Q4: NA
Q4a: NA
Q4b_eval: NA
Q4b_input: NA
Q4b_complete: NA
Q4b_partial: NA
Q4b_none: NA
Q4c_input: NA
S4_output: NA
Q5: NA
Q5_eval: NA
Q5_text: NA
S5_output: NA
Q5_popup: NA
Q6: NA
Q6a: NA
S6_url: NA
S6_output: NA
Q7: NA
Q7a: NA
Q7b: NA
Q7c: NA
S7_url: NA
S7_output: NA
Q7_popup: NA
editor: NA
---
<span style="color: black;">**Scientific transparency statement**</span>
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, results='asis')
library(pander)
library(tidyverse)
panderOptions('table.continues', '')
```
```{r wrangling, include=FALSE}
# data
dataURLs=""
if (!is.null(params$Q2b_input)){ # if access conditions were provided
if (any(!is.na(params$Q2b_input$X6))){ # check whether URL was provided
dataURLs = filter(params$Q2b_input, !is.na(X6))$X6 #params$Q2b_input$X6
}
}
# code
codeURLs=""
if (!is.null(params$Q3b_input)){ # if access conditions were provided
if (any(!is.na(params$Q3b_input$X5))){ # check whether URL was provided
codeURLs = filter(params$Q3b_input, !is.na(X5))$X5 # params$Q3b_input$X5
}
}
# materials
matsURLs=""
if (!is.null(params$Q4b_input)){ # if access conditions were provided
if (any(!is.na(params$Q4b_input$X5))){ # check whether URL was provided
matsURLs = filter(params$Q4b_input, !is.na(X5))$X5 # params$Q4b_input$X5
}
}
# remove pop-up text responses if authors changed their answers
design_text <- shQuote(params$Q5_popup)
if (params$Q5 == "Yes") {
design_text <- ""
}
prereg_text <- shQuote(params$Q7_popup)
if (params$Q7 == "No") {
prereg_text <- ""
}
# process editor notes indicating where authors aren't compliant with standards
note <- ""
if ("Yes" %in% params$editor$Note) {
standards <- subset(params$editor, Note == "Yes") %>%
mutate(Standard = case_when(Standard == "2" ~ "Data",
Standard == "3" ~ "Analytic Methods (Code)",
Standard == "4" ~ "Research Materials",
Standard == "5" ~ "Design and Analysis Transparency",
Standard == "6" ~ "Pre-registration of Study Procedures",
Standard == "7" ~ "Pre-registration of Analysis Plans"))
# if only 1 standard has been failed
if (nrow(standards) < 2) {
note = paste("The responses provided regarding",
standards$Standard,
"may not yet be compliant with the transparency guidelines. This is likely to result in delays and additional inquiries unless changes are made to the manuscript and/or the Scientific Transparency Report.")
# if multiple standards have been failed
} else {
note = paste(
"The responses provided regarding",
paste0(as.character(standards$Standard), collapse = " and "),
"may not yet be compliant with the transparency guidelines. This is likely to result in delays and additional inquiries unless changes are made to the manuscript and/or the Scientific Transparency Report.")
}
}
# process public access routes
## data
data_access <- ""
if ("Data in Supplementary Information" %in% params$Q2b_input$X5 | "Data is contained in the paper" %in% params$Q2b_input$X5) {
data_access <- "Data contained in the manuscript or supplemental files. "
}
## code
code_access <- ""
if ("Code in Supplementary Information" %in% params$Q3b_input$X4 | "Code is contained in the paper" %in% params$Q3b_input$X4) {
code_access <- "Code contained in the manuscript or supplemental files. "
}
## materials
mat_access <- ""
if ("Materials are in Supplementary Information" %in% params$Q4b_input$X4 | "Materials are contained in the paper" %in% params$Q4b_input$X4) {
mat_access <- "Materials are contained in the manuscript or supplemental files. "
}
```
`r note`
<!-- data -->
`r if(params$S2_output == "A"){"DATA: This research did not involve collection or analysis of data."}`
`r if(params$S2_output == "B"){"DATA: All raw and processed data supporting this research are publicly available:"}`
`r if(params$S2_output == "C"){"DATA: Some raw and processed data supporting this research are publicly available, while some are subject to restrictions:"}` `r paste(unique(dataURLs[dataURLs != "" & !is.na(dataURLs)]), collapse = ", ")` `r data_access`
`r if(params$S2_output == "D"){"DATA: No raw or processed data supporting this research are publicly available."}`
<!-- code -->
`r if(params$S3_output == "A"){"CODE: This research did not make use of any analysis code."}`
`r if(params$S3_output == "B"){"CODE: All analysis code supporting this research is publicly available:"}`
`r if(params$S3_output == "C"){"CODE: Some analysis code supporting this research is publicly available, while some are subject to restrictions:"}` `r paste(unique(codeURLs[codeURLs != "" & !is.na(codeURLs)]), collapse = ", ")` `r code_access`
`r if(params$S3_output == "D"){"CODE: No analysis code supporting this research is publicly available."}`
<!-- materials -->
`r if(params$S4_output == "A" | params$S4_output == "B"){"MATERIALS: This research did not make use of any materials to generate or acquire data."}`
`r if(params$S4_output == "C"){"MATERIALS: All study materials supporting this research are publicly available:"}`
`r if(params$S4_output == "D"){"MATERIALS: Some study materials supporting this research are publicly available, while some are subject to restrictions:"}` `r paste(unique(matsURLs[matsURLs != "" & !is.na(matsURLs)]), collapse = ", ")` `r mat_access`
`r if(params$S4_output == "E"){"MATERIALS: No study materials supporting this research are publicly available."}`
<!-- design -->
`r if(params$Q5 == "Yes"){"DESIGN: This article reports, for all studies, how the author(s) determined all sample sizes, all data exclusions, all data inclusion and exclusion criteria, and whether inclusion and exclusion criteria were established prior to data analysis."}`
`r if(params$Q5 == "No"){"DESIGN: The authors indicated that aspects of the sample size determination, data exclusions, and inclusion or exclusion criteria were not reported in the article. The authors provided the following explanation:"}`
`r if(params$Q5 == "Not Applicable"){"DESIGN: The authors indicated that reporting the sample size determination, data exclusions, and inclusion and exclusion criteria was not applicable to this research. They provided the following justification:"}` `r design_text`
<!-- preregistration -->
`r if(params$Q6 == "No"){"PRE-REGISTRATION: No part of the study procedures was pre-registered in a time-stamped, institutional registry prior to the research being conducted."}` `r if(params$Q6 != "No"){"PRE-REGISTRATION: At least part of the study procedures was pre-registered in a time-stamped, institutional registry prior to the research being conducted:"}` `r trimws(params$Q6a)` `r if(params$Q7 == "No"){"No part of the analysis plans was pre-registered in a time-stamped, institutional registry prior to the research being conducted."}` `r if(params$S7_output == "B" | params$S7_output == "C" | params$S7_output == "D"){"At least part of the analysis plans was pre-registered in a time-stamped, institutional registry prior to the research being conducted:"}` `r trimws(params$Q7a)` `r if(params$S7_output == "C"){"The analyses that were undertaken deviated from the preregistered analysis plans. All such deviations are fully disclosed in the manuscript."}` `r if(params$S7_output == "D"){"The analyses that were undertaken deviated from the preregistered analysis plans. These deviations are not fully disclosed in the manuscript. The authors provided the following justification:"}` `r prereg_text`
For full details, see the *Scientific Transparency Report* in the supplementary data to the online version of this article.