convert_df {metaConvert}R Documentation

Automatically compute effect sizes from a well formatted dataset

Description

Automatically compute effect sizes from a well formatted dataset

Usage

convert_df(
  x,
  measure = c("d", "g", "md", "logor", "logrr", "logirr", "nnt", "r", "z", "logvr",
    "logcvr"),
  main_es = TRUE,
  es_selected = c("hierarchy", "minimum", "maximum"),
  split_adjusted = TRUE,
  format_adjusted = c("wide", "long"),
  verbose = TRUE,
  hierarchy = "means_sd > means_se > means_ci",
  rr_to_or = "metaumbrella",
  or_to_rr = "metaumbrella_cases",
  or_to_cor = "bonett",
  table_2x2_to_cor = "lipsey",
  smd_to_cor = "viechtbauer",
  pre_post_to_smd = "bonett",
  r_pre_post = 0.5,
  cor_to_smd = "viechtbauer",
  unit_type = "raw_scale",
  yates_chisq = FALSE
)

Arguments

x

a well formatted dataset

measure

the effect size measure that will be estimated from the information stored in the dataset. See details.

main_es

a logical variable indicating whether a main effect size should be selected when overlapping data are present. See details.

es_selected

the method used to select the main effect size when several information allows to estimate an effect size for the same association/comparison. Must be either "minimum" (the smallest effect size will be selected), "maximum" (the largest effect size will be selected) or "hierarchy" (the effect size computed from the information specified highest in the hierarchy will be selected). See details.

split_adjusted

a logical value indicating whether crude and adjusted effect sizes should be presented separately. See details.

format_adjusted

presentation format of the adjusted effect sizes. See details.

verbose

a logical variable indicating whether text outputs and messages should be generated. We recommend turning this option to FALSE only after having carefully read all the generated messages.

hierarchy

a character string indicating the hierarchy in the information to be prioritized for the effect size calculations (see details). See details.

rr_to_or

formula used to convert the rr value into an odds ratio.

or_to_rr

formula used to convert the or value into a risk ratio.

or_to_cor

formula used to convert the or value into a correlation coefficient.

table_2x2_to_cor

formula used to obtain a correlation coefficient from the contingency table.

smd_to_cor

formula used to convert the cohen_d value into a coefficient correlation.

pre_post_to_smd

formula used to obtain a SMD from pre/post means and SD of two independent groups.

r_pre_post

pre-post correlation across the two groups (use this argument only if the precise correlation in each group is unknown)

cor_to_smd

formula used to convert a correlation coefficient value into a SMD.

unit_type

the type of unit for the unit_increase_iv argument. Must be either "sd" or "value" (see es_from_pearson_r).

yates_chisq

a logical value indicating whether the Chi square has been performed using Yate's correction for continuity.

Details

This function automatically computes or converts between 11 effect sizes measures from any relevant type of input data stored in the dataset you pass to this function.

Effect size measures

Possible effect size measures are:

  1. Cohen's d ("d")

  2. Hedges' g ("g")

  3. mean difference ("md")

  4. (log) odds ratio ("or" and "logor")

  5. (log) risk ratio ("rr" and "logrr")

  6. (log) incidence rate ratio ("irr" and "logirr")

  7. correlation coefficient ("r")

  8. transformed r-to-z correlation coefficient ("z")

  9. log variability ratio ("logvr")

  10. log coefficient of variation ("logcvr")

  11. number needed to treat ("nnt")

Computation of a main effect size

If you enter multiple types of input data (e.g., means/sd of two groups and a student t-test value) for the same comparison i.e., for the same row of the dataset, the convert_df() function can have two behaviours. If you set:

Selection of input data for the computation of the main effect size

If you choose to estimate one main effect size (i.e., by setting main_es = TRUE), you have several options to select this main effect size. If you set:

Hierarchy

More than 70 different combinations of input data can be used to estimate an effect size. You can retrieve the effect size measures estimated by each combination of input data in the see_input_data() function.

In the hierarchy argument, each type of input data should be separated by the symbol ">". You can prioritize some types of input data by placing them at the begining of the hierarchy argument. For example, if you set:

Importantly, if none of the types of input data indicated in the hierarchy argument can be used to estimate the target effect size measure, the convert_df() function will automatically try to use other types of input data to estimate an effect size.

Adjusted effect sizes

Some datasets will be composed of crude (i.e., non-adjusted) types of input data (such as standard means + SD, Student's t-test, etc.) and adjusted types of input data (such as means + SE from an ANCOVA model, a t-test from an ANCOVA, etc.).

In these situations, you can decide to:

If you want to split the calculations, you can decide to present the final dataset:

Value

The convert_df() function returns a list of more than 70 dataframes (one for each function automatically applied to the dataset). These dataframes systematically contain the columns described in metaConvert-package. The list of dataframes can be easily converted to a single, calculations-ready dataframe using the summary function (see summary.metaConvert).

Examples

res <- convert_df(df.haza,
  measure = "g",
  split_adjusted = TRUE,
  es_selected = "minimum",
  format_adjusted = "long"
)
summary(res)

[Package metaConvert version 1.0.0 Index]