View source: R/calculateEffectSizes.R
calculateEffectSizes | R Documentation |
This is a function to calculate effect sizes of meta-analysis data created by expandMultiarmTrials
.
calculateEffectSizes(data, comp.id.indicator = "id", trt.indicator = "trt", funcs = list(meanSD = meanSD, binaryES = binaryES, changeES = changeES), include.switched.arms = FALSE, change.sign = NULL, data.format = NULL)
data |
Meta-analysis data set of class |
comp.id.indicator |
|
trt.indicator |
|
funcs |
|
include.switched.arms |
|
change.sign |
|
data.format |
|
By default, the small-sample bias corrected standardized mean difference (Hedges' g) is calculated from:
the mean, SD and N
binary outcome data (i.e. response counts) and
change scores
Other functions can be added to the list provided to funcs
. However, results of the function must result in a data.frame
with the same number of rows as in data
, and two columns: one for the calculated g value (named es
) and its standard error (named se
).
In rows for which no fitting raw data was supplied, the resulting data.frame
should contain NA
.
For more details see the help vignette: vignette("metapsyTools")
calculateEffectSizes
returns the meta-analysis data set as class data.frame
in wide format (if results are saved to a variable). It also generates the following columns, wich are added to the data:
es
calculated effect sizes for each comparison.
se
calculated standard error of the effect size.
study.id
a study-specific ID variable.
study
a study-specific variable containing its name. For multiarm studies, this variable specifies the active treatment arm used to calculate the effect.
Mathias Harrer mathias.h.harrer@gmail.com, Paula Kuper paula.r.kuper@gmail.com, Pim Cuijpers p.cuijpers@vu.nl
expandMultiarmTrials
## Not run: #Example 1: use function in default mode; requires data created by expandMultiarmTrials data("inpatients") inpatients %>% expandMultiarmTrials() %>% calculateEffectSizes() #Example 2: further use to pool effect sizes library(meta) inpatients %>% checkDataFormat() %>% expandMultiarmTrials() %>% calculateEffectSizes() %>% filterPoolingData(primary==1) %>% metagen(es, se, studlab=study, fixed=FALSE, data=.) # Example 3: use for 3-level model library(metafor) library(dplyr) inpatients %>% checkDataFormat ()%>% expandMultiarmTrials() %>% calculateEffectSizes() %>% dplyr::mutate(es.id = 1:nrow(.)) %>% metafor::rma.mv(es, se^2, data = ., slab = study.id, random = ~ 1 | study.id/es.id, test = "t") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.