---
title: "Vignette 1. General guidance about metaConvert"
author: "Gosling CJ, Cortese S, Solmi M, Haza B, Vieta E, Delorme R, Fusar-Poli P, Radua J"
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
toc: true
vignette: >
%\VignetteIndexEntry{Vignette 1. General guidance about metaConvert}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{=html}
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='hide'}
library(metaConvert)
library(DT)
```
# Step 1. Protocol stage
If you have not yet registered your protocol, you can benefit of our tools to select **a priori** the type of input data that could be extracted to estimate an effect size.
- start by determining the effect size measure (SMD, OR, RR, etc.) you plan to estimate
- then, identify all types of input data that can be used to estimate this effect size measure
```{r, eval = FALSE}
see_input_data(measure = "or")
```
```{r, echo=FALSE}
DT::datatable(see_input_data(measure = "or", type_of_measure = "natural", extension="data.frame"), options = list(
scrollX = TRUE,
dom = c('t'),
scrollY = "300px",
pageLength = 500,
ordering = FALSE,
rownames = FALSE,
columnDefs = list(
list(width = '130px',
targets = "_all"),
list(className = 'dt-center',
targets = "_all"))))
```
- last, generate a data extraction sheet for this effect size measure
```{r, eval = FALSE}
data_extraction_sheet(measure = "or")
```
```{r, echo=FALSE}
DT::datatable(data_extraction_sheet(measure = "or", extension="data.frame"), options = list(
scrollX = TRUE,
dom = c('t'),
ordering = FALSE,
rownames = FALSE,
columnDefs = list(
list(width = '130px',
targets = "_all"),
list(className = 'dt-center',
targets = "_all"))))
```
# Step 2. Dataset comparison
When data extraction has been performed in duplicate, our tools offer the possibility to flag the differences between the two datasets. For this example, we will use two datasets (df.compare1 and df.compare2) distributed with metaConvert.
```{r, message=FALSE, fig.width= 11}
compare_df(
df_extractor_1 = df.compare1,
df_extractor_2 = df.compare2,
output = "html")
```
In grey, values that are consistent between the two data extractors. In green/red, the values that differ.
Only rows with differences between the two datasets are identified, and you can easily retrieve the row number by looking at the ID in the rowname column. If your dataset have rows in a different order (like in the example above), you can automatically reorder your datasets by indicating to the function the columns that store this information
```{r, message=FALSE, fig.width= 11}
compare_df(
df_extractor_1 = df.compare1,
df_extractor_2 = df.compare2,
ordering_columns = c("author", "year"),
output = "html")
```
# Step 3. Effect size computation
## Basic usage
To generate an effect size from a dataset that contains approriate column names and information, you simply need to :