Learn R Programming

metafor (version 0.5-0)

ranktest: Rank Correlation Test for Funnel Plot Asymmetry

Description

Rank correlation test for funnel plot asymmetry by Begg and Mazumdar (1994).

Usage

ranktest(yi, vi, sei, data=NULL, subset=NULL)

Arguments

yi
a vector with the observed effect sizes or outcomes.
vi
a vector with the corresponding sampling variances.
sei
a vector with the corresponding standard errors. (note: only one of the two, vi or sei, needs to be specified)
data
an optional data frame containing the variables given to the arguments above.
subset
an optional vector indicating the subset of studies that should be used for the calculation. This can be a logical vector of length $k$ or a numeric vector indicating the indices of the observations to include.

Value

  • See the documentation for the cor.test function.

Details

The function carries out the rank correlation test as described in Begg and Mazumdar (1994). The test can be used to examine whether the observed outcomes and the corresponding sampling variances are correlated. An asymmetric funnel plot would give rise to such a correlation and may be indicative of publication bias. The function is actually a wrapper for the cor.test function with method="kendall". If possible, an exact p-value is provided; otherwise, a large-sample approximation is used.

References

Begg, C. B. & Mazumdar, M. (1994) Operating characteristics of a rank correlation test for publication bias. Biometrics, 50, 1088--1101. Egger, M., Davey Smith, G., Schneider, M. & Minder, C. (1997) Bias in meta-analysis detected by a simple, graphical test. British Medical Journal, 315, 629--634. Macaskill, P., Walter, S. D. & Irwing, L. (2001) A comparison of methods to detect publication bias in meta-analysis. Statistics in Medicine, 20, 641--654. Moreno, S. G., Sutton, A. J., Ades, A. E., Stanley, T. D., Abrams, K. R., Peters, J. L. & Cooper, N. J. (2009) Assessment of regression-based methods to adjust for publication bias through a comprehensive simulation study. BMC Medical Research Methodology, 9:2. Peters, J. L., Sutton, A. J., Jones, D. R., Abrams, K. R. & Rushton, L. (2006) Comparison of two methods to detect publication bias in meta-analysis. Journal of the American Medical Association, 295, 676--680. Sterne, J. A. C. & Egger, M. (2005). Regression methods to detect publication and other bias in meta-analysis. In H. R. Rothstein, A. J. Sutton & M. Borenstein (Eds.) (2005) Publication bias in meta-analysis: Prevention, assessment, and adjustments (pp. 99--110). Chichester, England: Wiley.

See Also

funnel, fsn, trimfill

Examples

Run this code
### load BCG vaccine data
data(dat.bcg)

### calculate log risk rates and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
dat.bcg$yi <- dat$yi
dat.bcg$vi <- dat$vi

ranktest(yi, vi, data=dat.bcg)

### Egger's regression test (multiplicative model)
summary(lm(yi ~ sqrt(vi), weights=1/vi, data=dat.bcg))

### Egger's regression test (fixed-effects model)
rma(yi, vi, mods=sqrt(vi), data=dat.bcg, method="FE")

### Egger's regression test (random-effects model)
rma(yi, vi, mods=sqrt(vi), data=dat.bcg, method="DL")

### Egger's test using the sampling variance as moderator
summary(lm(yi ~ vi, weights=1/vi, data=dat.bcg))
rma(yi, vi, mods=vi, data=dat.bcg, method="FE")
rma(yi, vi, mods=vi, data=dat.bcg, method="DL")

### add total sample size to data frame
dat.bcg$n.tot <- dat.bcg$tpos + dat.bcg$tneg + dat.bcg$cpos + dat.bcg$cneg

### Macaskill's test (using total sample size)
summary(lm(yi ~ n.tot, weights=1/vi, data=dat.bcg))

### Peters' test (using inverse of total sample size)
summary(lm(yi ~ I(1/n.tot), weights=1/vi, data=dat.bcg))

### note: one may consider using a pooled estimate of the sampling variance 
### to reduce the correlation between yi and vi; see Macaskill et al. (2005) 
### and Peters et al. (2006) for more details when using odds ratios as the
### outcome measure

### Egger's regression test using a mixed-effects model that also
### includes absolute latitude as a moderator
rma(yi, vi, mods=cbind(ablat, sei=sqrt(vi)), data=dat.bcg, method="DL")

Run the code above in your browser using DataLab