Convert from individual to summary data in meta-analyses
Allows one-way conversion from full to summary data. Input must be pre-formatted appropriately.
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"
)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) |
effect |
what effect to calculate? a |
rare_event_correction |
If effect is |
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 |
summarise |
logical; |
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 |
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:
conversion to log scale,
calculating change from baseline,
summarising data (using appropriate effect)
If you summarise data.frame with columns for group tau and se.tau
(for effect = "mean", also baseline means, for "logRR" or "logOR" also
a, b, c, d, which correspond to typical contingency table notation).
If you do not summarise data, individual level data will be returned, but some columns may be renamed or transformed (see above).
Witold Wiecek
convert_inputs for how any type of data is (internally) converted into Stan inputs;
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.