Learn R Programming

metafor (version 1.4-0)

transf: Transformation Functions

Description

A set of transformation functions useful for meta-analyses.

Usage

transf.rtoz(x, ...)
transf.ztor(x, ...)
transf.logit(x, ...)
transf.ilogit(x, ...)
transf.arcsin(x, ...)
transf.iarcsin(x, ...)
transf.ztor.int(x, targs, ...)
transf.exp.int(x, targs, ...)
transf.ilogit.int(x, targs, ...)

Arguments

x
a vector of values to be transformed.
targs
a list with additional arguments for the transformation function. See Details.
...
other arguments.

Value

  • A vector with the transformed values.

Details

The following transformation functions are currently implemented:
  • transf.rtoz: Fisher's r-to-z transformation.
  • transf.ztor: inverse of the Fisher's r-to-z transformation.
  • transf.logit: logit (log odds) transformation.
  • transf.ilogit: inverse of the logit transformation.
  • transf.arcsin: arcsine transformation.
  • transf.iarcsin: inverse of the arcsine transformation.
  • transf.ztor.int: integral transformation method for the z-to-r transformation.
  • transf.exp.int: integral transformation method for the exponential transformation.
  • transf.ilogit.int: integral transformation method for the inverse of the logit transformation.
The integral transformation method for a transformation function $h(z)$ integrates $h(z) f(z)$ over $z$ using the limits targs$lower and targs$upper, where $f(z)$ is the density of a normal distribution with mean equal to x and variance equal to targs$tau2.

References

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. http://www.jstatsoft.org/v36/i03/.

Examples

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

### meta-analysis of the log relative risks using a random-effects model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, 
           measure="RR", data=dat.bcg, method="REML")

### average relative risk with 95\% CI
predict(res, transf=exp)

### average relative risk with 95\% CI using integral transformation
predict(res, transf=transf.exp.int, targs=list(tau2=res$tau2, lower=-4, upper=4))

Run the code above in your browser using DataLab