| Title: | Useful functions for performing evidence triangulation |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | Luke McGuinness [aut] (ORCID: <https://orcid.org/0000-0001-8730-9761>), Tassia Jones [aut], Chin Yang Shapland [aut, cre] |
| Maintainer: | Chin Yang Shapland <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-05-16 08:06:00 UTC |
| Source: | https://github.com/mcguinlu/triangulate |
Beta-carotene RoB Judgments (Raw) Domain-level risk of bias judgments for 15 studies of beta-carotene and cardiovascular outcomes.
beta_carotene_databeta_carotene_data
A data frame with 27 rows and 25 variables.
Supplement to Shapland et al. (2024)
Example risk of bias assessments
dat_biasdat_bias
A data frame with 20 rows and 26 variables
Example priors for the bias adjustment
dat_bias_valuesdat_bias_values
A data frame with 3 rows and 6 variables
Example indirectness assessments
dat_inddat_ind
A data frame with 20 rows and 14 variables
Example priors for indirectness adjustment
dat_ind_valuesdat_ind_values
A data frame with 3 rows and 6 variables
Launches a Shiny app that allows users to adjust additive and proportional bias priors and visualizes both original and adjusted estimates horizontally.
interactive_bias_plot(dat)interactive_bias_plot(dat)
dat |
A data.frame with columns: result_id, yi, vi, study, type |
A Shiny app object
Converts qualitative bias direction labels (e.g. "Favours comparator") into absolute directions ("left" or "right") based on effect size and bias type.
tri_absolute_direction(dat)tri_absolute_direction(dat)
dat |
Data in long format |
Reverses the transformation done by tri_absolute_direction(), converting
absolute directions ("left"/"right") back to labels like "Favours comparator".
tri_absolute_direction_invert(dat)tri_absolute_direction_invert(dat)
dat |
Data in long format |
Converts data between wide and long format while applying or reversing the absolute direction transformation.
tri_absolute_direction_quick(dat, invert = FALSE)tri_absolute_direction_quick(dat, invert = FALSE)
dat |
Dataset in wide format ## check this is the correct parameter |
invert |
If TRUE, reverse transformation (absolute → qualitative) |
Joins the appropriate prior parameters to a long-format bias dataset, based on the risk-of-bias judgment (j), direction (d), and type (t).
tri_append_bias(dat, values = NULL, common = TRUE)tri_append_bias(dat, values = NULL, common = TRUE)
dat |
A bias dataset in long format (must include j, d, t, domain, result_id) |
values |
A data frame of prior distributions (e.g., from dat_bias_values) |
common |
Should a single set of prior distributions be used across all domains (default is TRUE)? Set to FALSE to allow domain-specific priors. |
Dataset with numeric bias prior values appended
Similar to tri_append_bias(), but operates on indirectness judgments and priors
tri_append_indirect(dat, values, common = TRUE)tri_append_indirect(dat, values, common = TRUE)
dat |
A long-format indirectness dataset |
values |
A dataframe of indirectness priors (e.g., dat_ind_values) |
common |
Should a single set of distributions be used across all domains (default is TRUE)? |
Dataset with indirectness prior values appended
Computes adjusted effect estimates (yi_adj) and variances (vi_adj)
incorporating additive and proportional bias adjustments.
tri_calculate_adjusted_estimates(dat)tri_calculate_adjusted_estimates(dat)
dat |
A dataset prepared using |
A tibble with added yi_adj and vi_adj columns
Validates whether key variables are present in the dataset. Can toggle between a basic ("minimal") check or a "full" check including columns needed for bias adjustment.
tri_dat_check(dat, mode = c("minimal", "full"))tri_dat_check(dat, mode = c("minimal", "full"))
dat |
A data frame (long or wide format) |
mode |
Check mode: either "minimal" or "full" |
Throws an error if required columns are missing. Otherwise returns TRUE (invisibly).
Creates a forest plot of both raw and adjusted effect estimates, alongside domain-level risk of bias annotations for each study.
tri_plot_bias_direction( dat, dat_adj = NULL, title = NULL, grouping = "type", rma_method = "REML", ... )tri_plot_bias_direction( dat, dat_adj = NULL, title = NULL, grouping = "type", rma_method = "REML", ... )
dat |
A dataframe output from |
dat_adj |
A data frame with adjusted estimates and variances, if different from the main input. |
title |
Optional plot title. |
grouping |
Column by which to stratify subgroups (default = |
rma_method |
Meta-analysis method passed to metafor::rma (e.g., "REML", "FE"). We use metafor's default which random-effects |
... |
Additional arguments passed to |
A forest plot is drawn (base graphics).
Aggregates domain-level prior data and calculates total adjustment values per study result. Supports additive and proportional adjustments.
tri_prep_data(dat_bias, dat_ind)tri_prep_data(dat_bias, dat_ind)
dat_bias |
Data with bias priors (long format) |
dat_ind |
Data with indirectness priors (long format) |
Data with yi/vi and adjustment components ready for adjustment
Flips effect estimates (yi) and proportional bias directions (d)
for specified study types (e.g., odds ratios) to ensure consistency
across studies using different metrics.
tri_swap_effect_direction(dat, types = NULL)tri_swap_effect_direction(dat, types = NULL)
dat |
A long-format triangulation dataset |
types |
A character vector of |
A modified dataset with adjusted yi and d values
Reshapes domain-level bias columns from wide format (e.g., d1j, d1t, d1d) to long format. Assumes columns follow naming pattern like d1j, d1t, d1d, d2j, etc.
tri_to_long(dat)tri_to_long(dat)
dat |
A data frame in wide format |
A long-format data frame with columns: domain, j, t, d
Reshapes domain-level bias columns from long format to wide format (e.g., d1j, d1t, d1d). Assumes long format with columns 'domain', 'j', 't', 'd'.
tri_to_wide(dat)tri_to_wide(dat)
dat |
A long-format triangulate dataset |
A wide-format data frame