filterPriorityRule: Filter data based on a priority rule

View source: R/filterPriorityRule.R

filterPriorityRuleR Documentation

Filter data based on a priority rule

Description

This function filters rows of a dataset based on a priority rule for specific variables defined by the user.

Usage

filterPriorityRule(.data, ..., .study.indicator = "study")

Arguments

.data

A data.frame containing the calculated effect sizes, as created by the calculateEffectSizes function.

...

<dplyr_data_masking>. A number of prioritized filtering rules for variables. Should follow the form variable = c("prio1", "prio2", ...). To apply multiple priority filters, simply separate them using a comma. For each study, rows are then selected based on the specified hierarchy for a variable. The priorities are provided as a concatenated vector, representing the variable levels. The level to appear first in this vector has the highest priority, the second one the second-largest priority, and so on. If a study contains none of the variable levels specified in the function call, the study is omitted entirely.

.study.indicator

character. Name of the variable in which the study IDs are stored.

Details

For more details see the help vignette: vignette("metapsyTools").

Value

filterPriorityRule 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. Further filters can be applied using filterPoolingData.

Author(s)

Mathias Harrer mathias.h.harrer@gmail.com, Paula Kuper paula.r.kuper@gmail.com, Pim Cuijpers p.cuijpers@vu.nl

See Also

filterPoolingData

Examples

## Not run: 
# Load data and calculate effect size
data("psyCtrSubset")
psyCtrSubset %>%
  checkDataFormat() %>%
  checkConflicts() %>%
  expandMultiarmTrials() %>%
  calculateEffectSizes() -> data

# Filterusing four priority rules
filterPriorityRule(data,
                   Cond_spec_trt1 = c("cbt", "pst"),
                   Cond_spec_trt2 = c("cau", "wl", "cbt"),
                   Outc_measure = c("cesd", "phq-9", "scl", "hdrs"),
                   Time = c("post", "fu")) -> res

## End(Not run)


MathiasHarrer/metapsyTools documentation built on May 1, 2022, 5:14 p.m.