prepare_ma {baggr}R Documentation

Convert from individual to summary data in meta-analyses

Description

Allows for one-way conversion from full to summary data or for calculation of effects for binary data. Input must be pre-formatted appropriately.

Usage

prepare_ma(
  data,
  effect = c("mean", "logOR", "logRR"),
  rare_event_correction = 0.25,
  log = FALSE,
  cfb = FALSE,
  summarise = TRUE,
  treatment = "treatment",
  baseline = NULL,
  group = "group",
  outcome = "outcome"
)

Arguments

data

either a data.frame of individual-level observations with columns for outcome (numeric), treatment (values 0 and 1) and group (numeric, character or factor); or, a data frame with binary data (must have columns a, c, b/n1, d/n2).

effect

what effect to calculate? a mean (and SE) of outcome in groups or (for binary data) logOR (odds ratio), logRR (risk ratio);

rare_event_correction

If effect is logOR or logRR, this correction is used when working with binary data only. The value of correction is added to all arms in trials where some arms had 0 events. Using corrections may bias results but is the only alternative to avoid infinite values.

log

logical; log-transform the outcome variable?

cfb

logical; calculate change from baseline? If yes, the outcome variable is taken as a difference between values in outcome and baseline columns

summarise

logical; TRUE by default, but you can disable it to obtain converted (e.g. logged) data with columns renamed

treatment

name of column with treatment variable

baseline

name of column with baseline variable

group

name of the column with grouping variable

outcome

name of column with outcome variable

Details

The conversions done by this function are not typically needed and may happen automatically when data is given to baggr. However, this function can be used to explicitly convert from full to reduced (summarised) data without analysing it in any model. It can be useful for examining your data and generating summary tables.

If multiple operations are performed, they are taken in this order:

  1. conversion to log scale,

  2. calculating change from baseline,

  3. summarising data (using appropriate effect)

Value

Author(s)

Witold Wiecek

See Also

convert_inputs for how any type of data is (internally) converted into a list of Stan inputs;


[Package baggr version 0.6.4 Index]