View source: R/checkConflicts.R
checkConflicts | R Documentation |
This function checks for potential data formatting conflicts that may produce errors or incorrect
results when applying the expandMultiarmTrials
function later on.
checkConflicts(.data, vars.for.id = c("study", "primary", "Outc_measure", "Time", "Time_weeks", "sr_clinician"), .no.arms = "no.arms", .condition.specification = "Cond_spec", .group.indicator = "condition", .group.names = list("ig" = "ig", "cg" = "cg"), .groups.column.indicator = c("_trt1", "_trt2"), data.format = NULL)
.data |
Meta-analysis data stored as a |
vars.for.id |
|
.no.arms |
|
.condition.specification |
|
.group.indicator |
|
.group.names |
|
.groups.column.indicator |
|
data.format |
|
The type of data returned by checkConflicts
depends on the outcome of the evaluation. When no problems
have been detected, the function simply returns the dataset provided in .data
.
When (potential) formatting formatting issues have been detected, the function throws a message and returns the affected
studies/data.frame
columns. In particular, results are provided within a list
of three objects:
allConflicts
, a data.frame
containing all affected rows, regardless of conflict type.
idConflicts
, a data.frame
containing rows with ID/number of arms conflicts.
cgConflicts
, a data.frame
containing rows with reference arm conflicts
(there must be a unique control/reference group for each comparison).
The returned list has class checkConflicts
.
Mathias Harrer mathias.h.harrer@gmail.com, Paula Kuper paula.r.kuper@gmail.com, Pim Cuijpers p.cuijpers@vu.nl
expandMultiarmTrials
## Not run: data("inpatients") data("psyCtrSubset") # Example 1: Use defaults and simply run checks psyCtrSubset %>% checkDataFormat() %>% checkConflicts() -> result # Example 2: Use defaults, run check and directly # proceed expanding multiarm trials/calculating effects inpatients %>% checkDataFormat() %>% checkConflicts() %>% expandMultiarmTrials() %>% calculateEffectSizes() -> result # Example 3: Define custom IDs (example generates error) vars.for.id = c("study", "primary", "Time", "Time_weeks") psyCtrSubset %>% checkDataFormat() %>% checkConflicts(vars.for.id) %>% expandMultiarmTrials(vars.for.id) -> res # Example 4: Wide format data("psyCtrSubsetWide") psyCtrSubsetWide %>% checkDataFormat() %>% checkConflicts() # Example 4: Wide format; overrule default input prompt checkConflicts(psyCtrSubsetWide, data.format = "wide") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.