View source: R/filterPoolingData.R
filterPoolingData | R Documentation |
This convenience function allows to create a filtered data set, which is then ready to be used for meta-analytic pooling.
filterPoolingData(.data, ..., .filter.missing.rows = FALSE, .es.column = es)
.data |
A |
... |
<dplyr_data_masking>. A number of filtering statements (using variables in |
.filter.missing.rows |
|
.es.column |
Name of the column in |
The filterPoolingData
function allows to apply several filters to your meta-analysis data set all at once.
When used in a pipe (%>%
), you only need to supply several filtering statements separated by commas, using the same column names as they appear
in the data set (e.g. primary == 1, meanage == 58
). The filtering statements are then connected using "AND" (&
).
If you want to apply an "OR" filter, simply use |
instead of a comma (e.g. type == "cbt" | format == 6
). To select all rows
that contain one of several values in a variable, use %in%
; e.g. study %in% c("Bailey, 2017", "Barth 2005")
.
The Detect
function can be used within the function call to search for variable elements which contain one or several
selected words (separated by |
). To include all rows which contain the word "cbt" or "wl" or "cau" in the "Cond_spec_trt2" variable,
we can use Detect(Cond_spect_trt2, "cbt|wl|cau")
. This will also filter out elements like "cbt (online)"
, because "cbt" is
included.
For more details see the help vignette: vignette("metapsyTools")
.
filterPoolingData
returns the filtered data set as class data.frame
.
The filtered data set should then be ready for meta-analytic pooling, for example using metagen.
Mathias Harrer mathias.h.harrer@gmail.com, Paula Kuper paula.r.kuper@gmail.com, Pim Cuijpers p.cuijpers@vu.nl
filterPriorityRule
## Not run: # Example 1: calculate effect sizes and then use multiple AND filters. data("inpatients") inpatients %>% expandMultiarmTrials() %>% calculateEffectSizes() %>% filterPoolingData(primary == 1, Outc_measure == "hamd") # Example 2: use OR filter inpatients %>% expandMultiarmTrials() %>% calculateEffectSizes() %>% filterPoolingData(primary == 1 | Outc_measure == "hamd") # Example 3: use %in% operator inpatients %>% expandMultiarmTrials() %>% calculateEffectSizes() %>% filterPoolingData(Outc_measure %in% c("hamd", "bdi-ii")) # Example 4: Search for studies using "fuzzy-ish" matching data("psyCtrSubset") psyCtrSubset %>% expandMultiarmTrials() %>% calculateEffectSizes() %>% filterPoolingData(Detect(Cond_spec_trt1 , "cbt|sup"), Detect(Cond_spec_trt2 , "wl|cau"), !study %in% "Heckman, 2011") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.