meta_mdiff_two {esci}R Documentation

Estimate meta-analytic difference in means across multiple two-group studies.

Description

meta_mdiff_two is suitable for synthesizing across multiple two-group studies (paired or independent) with a continuous outcome measure. It takes in raw data from each study. If all studies used the same measurement scale, a meta-analytic raw-score difference can be returned. If studies used different scales, a standardized mean difference can be returned. Studies can be all paired, all independent, or a mix. Equal variance can be assumed, or not. If standardized mean difference is the output, it is d_s when equal variance is assumed and d_avg when equal variance is not assumed.

Usage

meta_mdiff_two(
  data,
  comparison_means,
  comparison_sds,
  comparison_ns,
  reference_means,
  reference_sds,
  reference_ns,
  r = NULL,
  labels = NULL,
  moderator = NULL,
  contrast = NULL,
  effect_label = "My effect",
  reported_effect_size = c("mean_difference", "smd_unbiased", "smd"),
  assume_equal_variance = FALSE,
  random_effects = TRUE,
  conf_level = 0.95
)

Arguments

data

A data frame or tibble

comparison_means

Set of comparison_group means, 1 per study

comparison_sds

Set of comparison_group standard deviations, 1 per study, all > 0

comparison_ns

Set of comparison_group sample sizes, positive integers, 1 for each study

reference_means

Set of reference_group means, 1 per study

reference_sds

Set of comparison_group standard deviations, 1 per study, all > 0

reference_ns

Set of reference_group sample sizes, positive integers, 1 for each study

r

Optional correlation between measures for w-s studies, NA otherwise

labels

An optional collection of study labels

moderator

An optional factor to analyze as a categorical moderator, must have k > 2 per groups

contrast

An optional contrast to estimate between moderator levels; express as a vector of contrast weights with 1 weight per moderator level.

effect_label

Optional character giving a human-friendly name of the effect being synthesized

reported_effect_size

Character specifying effect size to return: Must be one of 'mean_difference', 'smd_unbiased' (to return an unbiased Cohen's d_s or d_avg) or 'smd' (to return d_s or d_avg without correction for bias). Defaults to mean_difference.

assume_equal_variance

Defaults to FALSE

random_effects

TRUE for random effect model; FALSE for fixed effects

conf_level

The confidence level for the confidence interval. Given in decimal form. Defaults to 0.95.

Details

Once you generate an estimate with this function, you can visualize it with plot_meta().

The meta-analytic effect size, confidence interval and heterogeneity estimates all come from metafor::rma().

The diamond ratio and its confidence interval come from CI_diamond_ratio().

If reported_effect_size is smd_unbiased or smd the conversion to Cohen's d is handled by CI_smd_ind_contrast().

Value

An esci-estimate object; a list of data frames and properties. Returned tables include:

Examples

# Data set -- see Introduction to the New Statistics, 2nd edition
data("data_mccabemichael_brain")

# Meta-analysis: random effects, no moderator
estimate <- esci::meta_mdiff_two(
  data = esci::data_mccabemichael_brain,
  comparison_means = "M Brain",
  comparison_sds = "s Brain",
  comparison_ns = "n Brain",
  reference_means = "M No Brain",
  reference_sds = "s No Brain",
  reference_ns = "n No Brain",
  labels = "Study name",
  effect_label = "Brain Photo Rating - No Brain Photo Rating",
  assume_equal_variance = TRUE,
  random_effects = TRUE
)
# Forest plot
myplot_forest <- esci::plot_meta(estimate)


# Meta-analysis: random effects, moderator
estimate_moderator <- esci::meta_mdiff_two(
  data = esci::data_mccabemichael_brain,
  comparison_means = "M Brain",
  comparison_sds = "s Brain",
  comparison_ns = "n Brain",
  reference_means = "M No Brain",
  reference_sds = "s No Brain",
  reference_ns = "n No Brain",
  labels = "Study name",
  moderator = "Research group",
  effect_label = "Brain Photo Rating - No Brain Photo Rating",
  assume_equal_variance = TRUE,
  random_effects = TRUE
)
# Forest plot
myplot_forest_moderator <- esci::plot_meta(estimate_moderator)


# Meta-analysis: random effects, moderator, output d_s
estimate_moderator_d <- esci::meta_mdiff_two(
  data = esci::data_mccabemichael_brain,
  comparison_means = "M Brain",
  comparison_sds = "s Brain",
  comparison_ns = "n Brain",
  reference_means = "M No Brain",
  reference_sds = "s No Brain",
  reference_ns = "n No Brain",
  labels = "Study name",
  moderator = "Research group",
  effect_label = "Brain Photo Rating - No Brain Photo Rating",
  assume_equal_variance = TRUE,
  random_effects = TRUE
)
# Forest plot
myplot_forest_moderator_d <- esci::plot_meta(estimate_moderator_d)



[Package esci version 1.0.3 Index]