Title: | A Bootstrap-Based Heterogeneity Test for Meta-Analysis |
---|---|
Description: | Implements a bootstrap-based heterogeneity test for standardized mean differences (d), Fisher-transformed Pearson's correlations (r), and natural-logarithm-transformed odds ratio (or) in meta-analysis studies. Depending on the presence of moderators, this Monte Carlo based test can be implemented in the random- or mixed-effects model. This package uses rma() function from the R package 'metafor' to obtain parameter estimates and likelihoods, so installation of R package 'metafor' is required. This approach refers to the studies of Anscombe (1956) <doi:10.2307/2332926>, Haldane (1940) <doi:10.2307/2332614>, Hedges (1981) <doi:10.3102/10769986006002107>, Hedges & Olkin (1985, ISBN:978-0123363800), Silagy, Lancaster, Stead, Mant, & Fowler (2004) <doi:10.1002/14651858.CD000146.pub2>, Viechtbauer (2010) <doi:10.18637/jss.v036.i03>, and Zuckerman (1994, ISBN:978-0521432009). |
Authors: | Ge Jiang [aut, cre], Han Du [aut], Zijun Ke [ctb] |
Maintainer: | Ge Jiang <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1.5 |
Built: | 2024-11-13 03:13:13 UTC |
Source: | https://github.com/gabriellajg/boot.heterogeneity |
boot.d
returns the bootstrap-based tests of the residual heterogeneity in random- or mixed- effects model of standardized mean differences (d).
boot.d( n1, n2, est, lambda = 0, model = "random", adjust = FALSE, mods = NULL, nrep = 10^4, p_cut = 0.05, boot.include = FALSE, parallel = FALSE, cores = 4, verbose = FALSE )
boot.d( n1, n2, est, lambda = 0, model = "random", adjust = FALSE, mods = NULL, nrep = 10^4, p_cut = 0.05, boot.include = FALSE, parallel = FALSE, cores = 4, verbose = FALSE )
n1 |
A vector of sample sizes from group 1 in each of the included studies. |
n2 |
A vector of sample sizes from group 2 in each of the included studies. |
est |
A vector of unbiased estimates of standardized mean differences. |
lambda |
Size of the magnitude to be tested in the alternative hypothesis of the heterogeneity magnitude test. Default to 0. |
model |
Choice of random- or mixed- effects models. Can only be set to |
adjust |
If biased estimates (i.e., g values) are provided, |
mods |
Optional argument to include moderators in the model. |
nrep |
Number of replications used in bootstrap simulations. Default to 10^4. |
p_cut |
Cutoff for p-values, which is the alpha level. Default to 0.05. |
boot.include |
If true, bootstrap simulation results are included in the output (e.g., bootstrap critical values). |
parallel |
If true, parallel computing using 4 cores will be performed during bootstrapping stage. Otherwise, for loop is used. |
cores |
The number of cores used in the parallel computing. Default to 4. |
verbose |
If true, show the progress of bootstrapping. |
For standardized mean difference, if the biased estimates (i.e., g values) are provided, adjust=TRUE
can be specified to obtain the corresponding unbiased estimates.
This function returns the test statistics as well as their p-value and significances using (1) Q-test and (2) Bootstrap-based Heterogeneity Test with Restricted Maximum Likelihood (REML).
The results of significances are classified as "sig" or "n.s" based on the cutoff p-value (i.e., alpha level). "sig" means that the between-study heterogeneity is significantly different from zero whereas "n.s" means the between-study heterogeneity is not significantly different from zero. The default alpha level is 0.05.
A dataframe that contains the test statistics ('stat'), p-values ('p_value'), and significances of effect size heterogeneity ("Heterogeneity").
Hedges, L. V. (1981). Distribution theory for glass’s estimator of effect size and related estimators. Journal of Educational and Behavioral Statistics, 6(2), 107–128.
Hedges, L. V., & Olkin, I. (1985). Statistical methods for meta-analysis. San Diego, CA: Academic Press.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1-48. URL: http://www.jstatsoft.org/v36/i03/
# Demo 1: A meta-analysis of 18 studies in which the effect of open versus # traditional education on students' self-concept was studied (Hedges & Olkin, 1985). selfconcept <- boot.heterogeneity:::selfconcept # n1 and n2 are lists of samples sizes in two groups n1 <- selfconcept$n1 n2 <- selfconcept$n2 # g is a list of biased estimates of standardized mean differences in the meta-analytical study g <- selfconcept$g cm <- (1-3/(4*(n1+n2-2)-1)) #correct factor to compensate for small sample bias (Hedges, 1981) d <- cm*g ## Not run: boot.run <- boot.d(n1, n2, est = d, model = 'random', p_cut = 0.05) # is equivalent to: boot.run2 <- boot.d(n1, n2, est = g, model = 'random', adjust = TRUE, p_cut = 0.05) ## End(Not run) # Demo 2: A hypothetical meta-analysis of 15 studies with 3 moderators. hypo_moder <- boot.heterogeneity:::hypo_moder ## Not run: boot.run3 <- boot.d(n1 = hypo_moder$n1, n2 = hypo_moder$n2, est = hypo_moder$d, model = 'mixed', mods = cbind(hypo_moder$cov.z1, hypo_moder$cov.z2, hypo_moder$cov.z3), p_cut = 0.05) ## End(Not run)
# Demo 1: A meta-analysis of 18 studies in which the effect of open versus # traditional education on students' self-concept was studied (Hedges & Olkin, 1985). selfconcept <- boot.heterogeneity:::selfconcept # n1 and n2 are lists of samples sizes in two groups n1 <- selfconcept$n1 n2 <- selfconcept$n2 # g is a list of biased estimates of standardized mean differences in the meta-analytical study g <- selfconcept$g cm <- (1-3/(4*(n1+n2-2)-1)) #correct factor to compensate for small sample bias (Hedges, 1981) d <- cm*g ## Not run: boot.run <- boot.d(n1, n2, est = d, model = 'random', p_cut = 0.05) # is equivalent to: boot.run2 <- boot.d(n1, n2, est = g, model = 'random', adjust = TRUE, p_cut = 0.05) ## End(Not run) # Demo 2: A hypothetical meta-analysis of 15 studies with 3 moderators. hypo_moder <- boot.heterogeneity:::hypo_moder ## Not run: boot.run3 <- boot.d(n1 = hypo_moder$n1, n2 = hypo_moder$n2, est = hypo_moder$d, model = 'mixed', mods = cbind(hypo_moder$cov.z1, hypo_moder$cov.z2, hypo_moder$cov.z3), p_cut = 0.05) ## End(Not run)
boot.fcor
returns the bootstrap-based tests of the residual heterogeneity in random- or mixed- effects model of Pearson's correlation coefficients transformed with Fisher's r-to-z transformation (z scores).
boot.fcor( n, z, lambda = 0, model = "random", mods = NULL, nrep = 10^4, p_cut = 0.05, boot.include = FALSE, parallel = FALSE, cores = 4, verbose = FALSE )
boot.fcor( n, z, lambda = 0, model = "random", mods = NULL, nrep = 10^4, p_cut = 0.05, boot.include = FALSE, parallel = FALSE, cores = 4, verbose = FALSE )
n |
A vector of sample sizes in each of the included studies. |
z |
A vector of Fisher-transformed Pearson's correlations. |
lambda |
Size of the magnitude to be tested in the alternative hypothesis of the heterogeneity magnitude test. Default to 0. |
model |
Choice of random- or mixed- effects models. Can only be set to |
mods |
Optional argument to include moderators in the model. |
nrep |
Number of replications used in bootstrap simulations. Default to 10^4. |
p_cut |
Cutoff for p-value, which is the alpha level. Default to 0.05. |
boot.include |
If true, bootstrap simulation results are included in the output. |
parallel |
If true, parallel computing using 4 cores will be performed during bootstrapping stage. Otherwise, for loop is used. |
cores |
The number of cores used in the parallel computing. Default to 4. |
verbose |
If true, show the progress of bootstrapping. |
This function returns the test statistics as well as their p-value and significances using (1) Q-test and (2) Bootstrap-based Heterogeneity Test with Restricted Maximum Likelihood (REML).
The results of significances are classified as "sig" or "n.s" based on the cutoff p-value (i.e., alpha level). "sig" means that the between-study heterogeneity is significantly different from zero whereas "n.s" means the between-study heterogeneity is not significantly different from zero. The default alpha level is 0.05.
A dataframe that contains the test statistics ('stat'), p-values ('p_value'), and significances of effect size heterogeneity ("Heterogeneity").
Zuckerman, M. (1994). Behavioral expressions and biosocial bases of sensation-seeking. New York, NY: Cambridge University Press.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1-48. URL: http://www.jstatsoft.org/v36/i03/
# A meta-analysis of 13 studies studying the correlation # between sensation-seeking scores and levels of monoamine oxidase (Zuckerman, 1994). sensation <- boot.heterogeneity:::sensation # n is a list of samples sizes n <- sensation$n # Pearson's correlation r <- sensation$r # Fisher's Transformation z <- 1/2*log((1+r)/(1-r)) ## Not run: #' boot.run <- boot.fcor(n, z, model = 'random', p_cut = 0.05) ## End(Not run)
# A meta-analysis of 13 studies studying the correlation # between sensation-seeking scores and levels of monoamine oxidase (Zuckerman, 1994). sensation <- boot.heterogeneity:::sensation # n is a list of samples sizes n <- sensation$n # Pearson's correlation r <- sensation$r # Fisher's Transformation z <- 1/2*log((1+r)/(1-r)) ## Not run: #' boot.run <- boot.fcor(n, z, model = 'random', p_cut = 0.05) ## End(Not run)
boot.lnOR
returns the bootstrap-based tests of the residual heterogeneity in random- or mixed- effects model of natural-logarithm-transformed observed odds ratio (lnOR).
boot.lnOR( n_00, n_01, n_10, n_11, lambda = 0, model = "random", mods = NULL, nrep = 10^4, p_cut = 0.05, boot.include = FALSE, parallel = FALSE, cores = 4, verbose = FALSE )
boot.lnOR( n_00, n_01, n_10, n_11, lambda = 0, model = "random", mods = NULL, nrep = 10^4, p_cut = 0.05, boot.include = FALSE, parallel = FALSE, cores = 4, verbose = FALSE )
n_00 |
A vector of number of participants who score negatively on both Y1 and Y2 (e.g., mortality cases in the control group). |
n_01 |
A vector of number of participants who score negatively on Y1 and positively on Y2 (e.g., recovery cases in the control group). |
n_10 |
A vector of number of participants who score positively on Y1 and negatively on Y2 (e.g., mortality cases in the experimental group). |
n_11 |
A vector of number of participants who score positively on both Y1 and Y2 (e.g., recovery cases in the experimental group). |
lambda |
Size of the magnitude to be tested in the alternative hypothesis of the heterogeneity magnitude test. Default to 0. |
model |
Choice of random- or mixed- effects models. Can only be set to |
mods |
Optional argument to include moderators in the model. |
nrep |
Number of replications used in bootstrap simulations. Default to 10^4. |
p_cut |
Cutoff for p-value, which is the alpha level. Default to 0.05. |
boot.include |
If true, bootstrap simulation results are included in the output (e.g., bootstrap critical values). |
parallel |
If true, parallel computing using 4 cores will be performed during bootstrapping stage. Otherwise, for loop is used. |
cores |
The number of cores used in the parallel computing. Default to 4. |
verbose |
If true, show the progress of bootstrapping. |
lnOR |
A vector of natural-logarithm-transformed odds ratio in the included studies, which is calculated as ln(n11*n00/n01/n10) |
For odds ratio, its standard error will be infinite if any one of the four cells in the contingency tables is zero. In this case, Haldane and Anscombe correction is used by adding 0.5 to each cell value (Anscombe, 1956; Haldane, 1940). This function returns the test statistics as well as their p-value and significances using (1) Q-test and (2) Bootstrap-based Heterogeneity Test with Restricted Maximum Likelihood (REML).
The results of significances are classified as "sig" or "n.s" based on the cutoff p-value (i.e., alpha level). "sig" means that the between-study heterogeneity is significantly different from zero whereas "n.s" means the between-study heterogeneity is not significantly different from zero. The default alpha level is 0.05.
A dataframe that contains the test statistics ('stat'), p-values ('p_value'), and significances of effect size heterogeneity ("Heterogeneity").
Silagy C, Lancaster T, Stead LF, Mant D, Fowler G. (2004). Nicotine replacement therapy for smoking cessation. Cochrane Database of Systematic Reviews 2004, Issue 3. Art. No.: CD000146. DOI: 10.1002/14651858.CD000146.pub2.
Anscombe, F. J. (1956). On estimating binomial response relations. Biometrika, 43(3/4), 461–464.
Haldane, J. (1940). The mean and variance of| chi 2, when used as a test of homogeneity, when expectations are small. Biometrika, 31(3/4), 346–355.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1-48. URL: http://www.jstatsoft.org/v36/i03/
# A meta-analysis consists of 26 studies on nicotine replacement therapy for smoking cessation library(HSAUR3) data(smoking) # Y1: receive treatment; Y2: stop smoking n_00 <- smoking$tc - smoking$qc # not receive treatement yet not stop smoking n_01 <- smoking$qc # not receive treatement but stop smoking n_10 <- smoking$tt - smoking$qt # receive treatement but not stop smoking n_11 <- smoking$qt # receive treatement and stop smoking lnOR <- log(n_11*n_00/n_01/n_10) ## Not run: boot.run <- boot.lnOR(n_00, n_01, n_10, n_11, model = 'random', p_cut = 0.05) ## End(Not run)
# A meta-analysis consists of 26 studies on nicotine replacement therapy for smoking cessation library(HSAUR3) data(smoking) # Y1: receive treatment; Y2: stop smoking n_00 <- smoking$tc - smoking$qc # not receive treatement yet not stop smoking n_01 <- smoking$qc # not receive treatement but stop smoking n_10 <- smoking$tt - smoking$qt # receive treatement but not stop smoking n_11 <- smoking$qt # receive treatement and stop smoking lnOR <- log(n_11*n_00/n_01/n_10) ## Not run: boot.run <- boot.lnOR(n_00, n_01, n_10, n_11, model = 'random', p_cut = 0.05) ## End(Not run)