Learn R Programming

baggr (version 0.2.0)

prepare_ma: Convert from individual to summary data in meta-analyses

Description

Allows one-way conversion from full to summary data. Input must be pre-formatted appropriately.

Usage

prepare_ma(data, log = FALSE, cfb = FALSE, summarise = TRUE,
  treatment = "treatment", baseline = NULL, group = "group",
  outcome = "outcome")

Arguments

data

data.frame of individual-level observations with columns for outcome (numeric), treatment (values 0 and 1) and group (numeric, character or factor); column names can be user-defined (see below)

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; convert to aggregate level data?

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

Value

data.frame with columns mu, se.mu, tau and se.tau

Details

The conversions done by this function are not typically needed and may happen automatically when data is fed 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.

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

  1. conversion to log scale,

  2. calculating change from baseline,

  3. summarising data.

See Also

convert_inputs for how data is converted into Stan inputs;