transf {metafor} | R Documentation |
Transformation Functions
Description
Functions to carry out various types of transformations that are useful for meta-analyses.
Usage
transf.rtoz(xi)
transf.ztor(xi)
transf.logit(xi)
transf.ilogit(xi)
transf.arcsin(xi)
transf.iarcsin(xi)
transf.pft(xi, ni)
transf.ipft(xi, ni)
transf.ipft.hm(xi, targs)
transf.isqrt(xi)
transf.irft(xi, ti)
transf.iirft(xi, ti)
transf.ahw(xi)
transf.iahw(xi)
transf.abt(xi)
transf.iabt(xi)
transf.r2toz(xi)
transf.ztor2(xi)
transf.ztor.int(xi, targs)
transf.exp.int(xi, targs)
transf.ilogit.int(xi, targs)
transf.dtou1(xi)
transf.dtou2(xi)
transf.dtou3(xi)
transf.dtobesd(xi)
transf.dtomd(xi, targs)
transf.dtorpb(xi, n1i, n2i)
transf.dtorbis(xi, n1i, n2i)
transf.rpbtorbis(xi, pi)
transf.rtorpb(xi, pi)
transf.rtod(xi, n1i, n2i)
transf.rpbtod(xi, n1i, n2i)
transf.lnortord(xi, pc)
transf.lnortorr(xi, pc)
transf.lnortod.norm(xi)
transf.lnortod.logis(xi)
transf.dtolnor.norm(xi)
transf.dtolnor.logis(xi)
transf.lnortortet.pearson(xi)
transf.lnortortet.digby(xi)
Arguments
xi |
vector of values to be transformed. |
ni |
vector of sample sizes. |
n1i |
vector of sample sizes for the first group. |
n2i |
vector of sample sizes for the second group. |
ti |
vector of person-times at risk. |
pc |
control group risk (either a single value or a vector). |
pi |
proportion of individuals falling into the first of the two groups that is created by the dichotomization. |
targs |
list with additional arguments for the transformation function. See ‘Details’. |
Details
The following transformation functions are currently implemented:
-
transf.rtoz
: Fisher's r-to-z transformation for correlation coefficients (same asatanh(x)
). -
transf.ztor
: inverse of the former (i.e., the z-to-r transformation; same astanh(x)
). -
transf.logit
: logit (log odds) transformation for proportions (same asqlogis(x)
). -
transf.ilogit
: inverse of the former (same asplogis(x)
). -
transf.arcsin
: arcsine square root transformation for proportions. -
transf.iarcsin
: inverse of the former. -
transf.pft
: Freeman-Tukey (double arcsine) transformation for proportions. See Freeman & Tukey (1950). Thexi
argument is used to specify the proportions and theni
argument the corresponding sample sizes. -
transf.ipft
: inverse of the former. See Miller (1978). -
transf.ipft.hm
: inverse of the former, using the harmonic mean of the sample sizes for the back-transformation. See Miller (1978). The sample sizes are specified via thetargs
argument (the list element should be calledni
). -
transf.isqrt
: inverse of the square root transformation (i.e., function to square a number). -
transf.irft
: Freeman-Tukey transformation for incidence rates. See Freeman & Tukey (1950). Thexi
argument is used to specify the incidence rates and theti
argument the corresponding person-times at risk. -
transf.iirft
: inverse of the former. -
transf.ahw
: transformation of coefficient alpha as suggested by Hakstian & Whalen (1976), except that \(1-(1-\alpha)^{1/3}\) is used (so that the transformed values are a monotonically increasing function of the \(\alpha\) values). -
transf.iahw
: inverse of the former. -
transf.abt
: transformation of coefficient alpha as suggested by Bonett (2002), except that \(-\log(1-\alpha)\) is used (so that the transformed values are a monotonically increasing function of the \(\alpha\) values). -
transf.iabt
: inverse of the former. -
transf.r2toz
: variance stabilizing transformation for the coefficient of determination, given by \(z_i = \frac{1}{2} \log\mathopen{}\left(\frac{1+\sqrt{R_i^2}}{1-\sqrt{R_i^2}}\right)\mathclose{}\) (see Olkin & Finn, 1995, but with the additional \(\frac{1}{2}\) factor). -
transf.ztor2
: inverse of the former. -
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 logit transformation. -
transf.dtou1
: transformation of standardized mean differences to Cohen's \(U_1\) values (Cohen, 1988). Under the assumption that the data for those in the first (say, treated) and second (say, control) group are normally distributed with equal variances but potentially different means, Cohen's \(U_1\) indicates the proportion of non-overlap between the two distributions (i.e., when \(d=0\), then \(U_1\) is equal to 0, which goes to 1 as \(d\) increases). -
transf.dtou2
: transformation of standardized mean differences to Cohen's \(U_2\) values (Cohen, 1988). Under the same assumptions as above, Cohen's \(U_2\) indicates the proportion in the first group that exceeds the same proportion in the second group (i.e., when \(d=0\), then \(U_2\) is equal to 0.5, which goes to 1 as \(d\) increases). -
transf.dtou3
: transformation of standardized mean differences to Cohen's \(U_3\) values (Cohen, 1988). Under the same assumptions as above, Cohen's \(U_3\) indicates the proportion of individuals in the first group that have a higher value than the mean of those in the second group (i.e., when \(d=0\), then \(U_3\) is equal to 0.5, which goes to 1 as \(d\) increases). -
transf.dtocles
: transformation of standardized mean differences to common language effect size (CLES) values (McGraw & Wong, 1992) (also called the probability of superiority). A CLES value indicates the probability that a randomly sampled individual from the first group has a higher value than a randomly sampled individual from the second group (i.e., when \(d=0\), then the CLES is equal to 0.5, which goes to 1 as \(d\) increases). -
transf.dtobesd
: transformation of standardized mean differences to binomial effect size display values (Rosenthal & Rubin, 1982). Note that the function only provides the proportion in the first group scoring above the median (the proportion in the second group scoring above the median is simply one minus this value). -
transf.dtomd
: transformation of standardized mean differences to mean differences given a known standard deviation (which needs to be specified via thetargs
argument). -
transf.dtorpb
: transformation of standardized mean differences to point-biserial correlations. Argumentsn1i
andn2i
denote the number of individuals in the first and second group, respectively. Ifn1i
andn2i
are not specified, the function assumesn1i = n2i
and uses the approximate formula \(r_{pb} = \frac{d}{\sqrt{d^2 + 4}}\). Ifn1i
andn2i
are specified, the function uses the exact transformation formula \(r_{pb} = \frac{d}{\sqrt{d^2 + h}}\), where \(h = \frac{m}{n_1} + \frac{m}{n_2}\) and \(m = n_1 + n_2 - 2\) (Jacobs & Viechtbauer, 2017). -
transf.dtorbis
: transformation of standardized mean differences to biserial correlations. Liketransf.dtorpb
, but the point-biserial correlations are then transformed to biserial correlations with \(r_{bis} = \frac{\sqrt{p(1-p)}}{f(z_p)} r_{pb}\), where \(p = \frac{n_1}{n_1+n_2}\) and \(f(z_p)\) denotes the density of the standard normal distribution at value \(z_p\), which is the point for which \(P(Z > z_p) = p\), with \(Z\) denoting a random variable following a standard normal distribution (Jacobs & Viechtbauer, 2017). -
transf.rpbtorbis
: transformation of point-biserial correlations to biserial correlations. Argumentpi
denotes the proportion of individuals falling into the first of the two groups that is created by the dichotomization (hence,1-pi
falls into the second group). Ifpi
is not specified, the function assumespi=0.5
, which corresponds to dichotomization at the median. The transformation is carried out as described fortransf.dtorbis
. -
transf.rtorpb
: transformation of Pearson product-moment correlations to the corresponding point-biserial correlations, when one of the two variables is dichotomized. Argumentpi
can be used to denote the proportion of individuals falling into the first of the two groups that is created by the dichotomization (hence,1-pi
falls into the second group). Ifpi
is not specified, the function assumespi=0.5
, which corresponds to dichotomization at the median. This function is simply the inverse oftransf.rpbtorbis
. -
transf.rtod
: transformation of Pearson product-moment correlations to the corresponding standardized mean differences, when one of the two variables is dichotomized. Argumentsn1i
andn2i
can be used to denote the number of individuals in the first and second group created by the dichotomization. Ifn1i
andn2i
are not specified, the function assumesn1i = n2i
. This function is simply the inverse oftransf.dtorbis
. -
transf.rpbtod
: transformation of point-biserial correlations to standardized mean differences. This is simply the inverse oftransf.dtorpb
. -
transf.lnortord
: transformation of log odds ratios to risk differences, assuming a particular value for the control group risk (which needs to be specified via thepc
argument). -
transf.lnortorr
: transformation of log odds ratios to risk ratios, assuming a particular value for the control group risk (which needs to be specified via thepc
argument). -
transf.lnortod.norm
: transformation of log odds ratios to standardized mean differences (assuming normal distributions) (Cox & Snell, 1989). -
transf.lnortod.logis
: transformation of log odds ratios to standardized mean differences (assuming logistic distributions) (Chinn, 2000). -
transf.dtolnor.norm
: transformation of standardized mean differences to log odds ratios (assuming normal distributions) (Cox & Snell, 1989). -
transf.dtolnor.logis
: transformation of standardized mean differences to log odds ratios (assuming logistic distributions) (Chinn, 2000). -
transf.lnortortet.pearson
: transformation of log odds ratios to tetrachoric correlations as suggested by Pearson (1900). -
transf.lnortortet.digby
: transformation of log odds ratios to tetrachoric correlations as suggested by Digby (1983).
Value
A vector with the transformed values.
Note
The integral transformation method for a transformation function \(h(z)\) is given by \[\int_{\textrm{lower}}^{\textrm{upper}} h(z) f(z) dz\] using the limits targs$lower
and targs$upper
, where \(f(z)\) is the density of a normal distribution with mean equal to xi
and variance equal to targs$tau2
. An example is provided below.
Author(s)
Wolfgang Viechtbauer wvb@metafor-project.org https://www.metafor-project.org
References
Bonett, D. G. (2002). Sample size requirements for testing and estimating coefficient alpha. Journal of Educational and Behavioral Statistics, 27(4), 335–340. https://doi.org/10.3102/10769986027004335
Chinn, S. (2000). A simple method for converting an odds ratio to effect size for use in meta-analysis. Statistics in Medicine, 19(22), 3127–3131. https://doi.org/10.1002/1097-0258(20001130)19:22<3127::aid-sim784>3.0.co;2-m
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, NJ: Lawrence Erlbaum Associates.
Cox, D. R., & Snell, E. J. (1989). Analysis of binary data (2nd ed.). London: Chapman & Hall.
Digby, P. G. N. (1983). Approximating the tetrachoric correlation coefficient. Biometrics, 39(3), 753–757. https://doi.org/10.2307/2531104
Fisher, R. A. (1921). On the “probable error” of a coefficient of correlation deduced from a small sample. Metron, 1, 1–32. http://hdl.handle.net/2440/15169
Freeman, M. F., & Tukey, J. W. (1950). Transformations related to the angular and the square root. Annals of Mathematical Statistics, 21(4), 607–611. https://doi.org/10.1214/aoms/1177729756
Hakstian, A. R., & Whalen, T. E. (1976). A k-sample significance test for independent alpha coefficients. Psychometrika, 41(2), 219–231. https://doi.org/10.1007/BF02291840
Jacobs, P., & Viechtbauer, W. (2017). Estimation of the biserial correlation and its sampling variance for use in meta-analysis. Research Synthesis Methods, 8(2), 161–180. https://doi.org/10.1002/jrsm.1218
McGraw, K. O., & Wong, S. P. (1992). A common language effect size statistic. Psychological Bulletin, 111(2), 361–365. https://doi.org/10.1037/0033-2909.111.2.361
Miller, J. J. (1978). The inverse of the Freeman-Tukey double arcsine transformation. American Statistician, 32(4), 138. https://doi.org/10.1080/00031305.1978.10479283
Olkin, I., & Finn, J. D. (1995). Correlations redux. Psychological Bulletin, 118(1), 155–164. https://doi.org/10.1037/0033-2909.118.1.155
Pearson, K. (1900). Mathematical contributions to the theory of evolution. VII. On the correlation of characters not quantitatively measurable. Philosophical Transactions of the Royal Society of London, Series A, 195, 1–47. https://doi.org/10.1098/rsta.1900.0022
Rosenthal, R., & Rubin, D. B. (1982). A simple, general purpose display of magnitude of experimental effect. Journal of Educational Psychology, 74(2), 166–169. https://doi.org/10.1037/0022-0663.74.2.166
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://doi.org/10.18637/jss.v036.i03
Examples
### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### fit random-effects model
res <- rma(yi, vi, data=dat)
### average risk ratio with 95% CI (but technically, this provides an
### estimate of the median risk ratio, not the mean risk ratio!)
predict(res, transf=exp)
### average risk ratio with 95% CI using the integral transformation
predict(res, transf=transf.exp.int, targs=list(tau2=res$tau2, lower=-4, upper=4))
### this also works
predict(res, transf=transf.exp.int, targs=list(tau2=res$tau2))
### this as well
predict(res, transf=transf.exp.int, targs=res$tau2)