Skip to content

Commit 5aa62b1

Browse files
committed
checked
1 parent 84280ef commit 5aa62b1

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

R/prepare_QA.Rmd

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ author: "Milou Sep"
44
date: "4/15/2021"
55
output: html_document
66
editor_options:
7-
chunk_output_type: inline
7+
chunk_output_type: console
88
---
99

1010
```{r setup, include=FALSE}
1111
rm(list = ls()) #clean environment
1212
# load files from OSF
1313
library(osfr)
1414
# Authenticate to OSF (see: http://centerforopenscience.github.io/osfr/articles/auth.html). Via osf_auth("PAT") in the commentline. (note PAT can be derived from OSF)
15-
1615
library(readxl)
1716
library(dplyr)
1817
library(tidyr)
@@ -22,7 +21,7 @@ library(viridis)
2221
```
2322

2423
# retrieve OSF files
25-
```{r eval=FALSE, include=FALSE}
24+
```{r include=FALSE}
2625
osf_retrieve_file("tckb5") %>% osf_download(path = "data", conflicts="overwrite") # QA data
2726
```
2827

@@ -74,7 +73,8 @@ head(QA.H)
7473
# Note: for QA score -> higher is better quality.
7574
Y=0; N=1; unclear =1/2
7675

77-
"valeria: "for sensitivity analysis, amount of potential bias was operationalized by summing the risk of bias of each item according to the definition: “yes” = 0, “unclear” = 0.5, “no” = 1."
76+
Bonapersona V, Kentrop J, Van Lissa CJ, van der Veen R, Joëls M, Sarabdjitsingh RA. The behavioral phenotype of early life adversity: A 3-level meta-analysis of rodent studies. Neurosci Biobehav Rev. 2019 Jul;102:299-307. doi: 10.1016/j.neubiorev.2019.04.021. Epub 2019 Apr 29. PMID: 31047892.
77+
-> "for sensitivity analysis, amount of potential bias was operationalized by summing the risk of bias of each item according to the definition: “yes” = 0, “unclear” = 0.5, “no” = 1."
7878

7979
## Clinical
8080
```{r}
@@ -94,7 +94,7 @@ QA.H %>%
9494
9595
# checks
9696
head(QA.H.recoded)
97-
is.na(QA.H.recoded) %>% any()#should be non
97+
is.na(QA.H.recoded) %>% any() # confirm no missing values
9898
```
9999

100100
## preclinical
@@ -119,9 +119,7 @@ QA.A %>%
119119
120120
#checks
121121
head(QA.A.recoded)
122-
123-
# QA.A.recoded
124-
is.na(QA.A.recoded) %>% any() # should be non
122+
is.na(QA.A.recoded) %>% any() # confirm no missing values
125123
```
126124

127125
# save recoded datafiles
@@ -130,15 +128,14 @@ saveRDS(QA.A.recoded, file = "processed_data/TRACE_QA_animal.RData")
130128
saveRDS(QA.H.recoded, file = "processed_data/TRACE_QA_human.RData")
131129
```
132130

133-
# filter data included in meta-analysis
134-
```{r}
131+
# Count data included in meta-analysis
132+
```{r eval=FALSE, include=FALSE}
135133
readRDS("processed_data/clinical.data.metaregression.RDS") %>%
136134
distinct(PMID) ->clinical.meta.papers
137135
nrow(clinical.meta.papers)
138136
```
139137

140-
141-
```{r}
138+
```{r eval=FALSE, include=FALSE}
142139
readRDS("processed_data/preclinical.data.metaregression.RDS") %>%
143140
distinct(PMID)->preclinical.meta.papers
144141
nrow(preclinical.meta.papers)
@@ -170,7 +167,6 @@ QA.H.recoded.long %>% head()
170167
```
171168

172169
#### numbers
173-
174170
calc %
175171
```{r}
176172
QA.H.recoded.long %>%
@@ -201,8 +197,6 @@ ggplot(QA.H.recoded.long, aes(fill=score, x=n, y=question)) +
201197
scale_fill_viridis(discrete = TRUE, #begin = 0.1, end = 0.9 ,
202198
direction = -1,
203199
option = "cividis") +
204-
205-
206200
# theme_minimal() +
207201
# theme_pubr()+
208202
theme_pubr(base_size = 8)+
@@ -242,7 +236,6 @@ QA.A.recoded.long %>% head()
242236
#### numbers
243237
calc %
244238
```{r}
245-
246239
QA.A.recoded.long %>%
247240
mutate(
248241
perc=round(
@@ -252,10 +245,9 @@ QA.A.recoded.long %>%
252245
filter(score == "Unclear")
253246
# filter(score == "Low Risk of Bias")
254247
# filter(score == "High Risk of Bias")
255-
256248
```
257-
```{r}
258249

250+
```{r}
259251
QA.A.recoded.long %>%
260252
mutate(
261253
perc=round(
@@ -265,11 +257,9 @@ QA.A.recoded.long %>%
265257
# filter(score == "Unclear")
266258
filter(score == "Low Risk of Bias")
267259
# filter(score == "High Risk of Bias")
268-
269260
```
270261

271262
```{r}
272-
273263
QA.A.recoded.long %>%
274264
mutate(
275265
perc=round(
@@ -281,6 +271,7 @@ QA.A.recoded.long %>%
281271
filter(score == "High Risk of Bias")
282272
283273
```
274+
284275
#### plots
285276
```{r}
286277
# https://www.r-graph-gallery.com/48-grouped-barplot-with-ggplot2.html

0 commit comments

Comments
 (0)