transf: Transformation Functions

transfR Documentation

Transformation Functions

Description

Functions to carry out various types of transformations that are useful for meta-analyses. \loadmathjax

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 as atanh(x)).

  • transf.ztor: inverse of the former (i.e., the z-to-r transformation; same as tanh(x)).

  • transf.logit: logit (log odds) transformation for proportions (same as qlogis(x)).

  • transf.ilogit: inverse of the former (same as plogis(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). The xi argument is used to specify the proportions and the ni 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 the targs argument (the list element should be called ni).

  • 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). The xi argument is used to specify the incidence rates and the ti 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 \mjeqn1-(1-\alpha)^1/31-(1-\alpha)^(1/3) is used (so that the transformed values are a monotonically increasing function of the \mjseqn\alpha values).

  • transf.iahw: inverse of the former.

  • transf.abt: transformation of coefficient alpha as suggested by Bonett (2002), except that \mjeqn-\log(1-\alpha)-log(1-\alpha) is used (so that the transformed values are a monotonically increasing function of the \mjseqn\alpha values).

  • transf.iabt: inverse of the former.

  • transf.r2toz: variance stabilizing transformation for the coefficient of determination, given by \mjeqnz_i = \frac12 \log\mathopen\left(\frac1+\sqrtR_i^21-\sqrtR_i^2\right)\mathclosez_i = 1/2 log((1+\sqrt(R_i^2))/(1-\sqrt(R_i^2))) (see Olkin & Finn, 1995, but with the additional \mjeqn\frac121/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 \mjseqnU_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 \mjseqnU_1 indicates the proportion of non-overlap between the two distributions (i.e., when \mjseqnd=0, then \mjseqnU_1 is equal to 0, which goes to 1 as \mjseqnd increases).

  • transf.dtou2: transformation of standardized mean differences to Cohen's \mjseqnU_2 values (Cohen, 1988). Under the same assumptions as above, Cohen's \mjseqnU_2 indicates the proportion in the first group that exceeds the same proportion in the second group (i.e., when \mjseqnd=0, then \mjseqnU_2 is equal to 0.5, which goes to 1 as \mjseqnd increases).

  • transf.dtou3: transformation of standardized mean differences to Cohen's \mjseqnU_3 values (Cohen, 1988). Under the same assumptions as above, Cohen's \mjseqnU_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 \mjseqnd=0, then \mjseqnU_3 is equal to 0.5, which goes to 1 as \mjseqnd 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 \mjseqnd=0, then the CLES is equal to 0.5, which goes to 1 as \mjseqnd 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 the targs argument).

  • transf.dtorpb: transformation of standardized mean differences to point-biserial correlations. Arguments n1i and n2i denote the number of individuals in the first and second group, respectively. If n1i and n2i are not specified, the function assumes n1i = n2i and uses the approximate formula \mjeqnr_pb = \fracd\sqrtd^2 + 4r_pb = d / \sqrtd^2 + 4. If n1i and n2i are specified, the function uses the exact transformation formula \mjeqnr_pb = \fracd\sqrtd^2 + hr_pb = d / \sqrtd^2 + h, where \mjeqnh = \fracmn_1 + \fracmn_2h = m / n_1 + m / n_2 and \mjseqnm = n_1 + n_2 - 2 (Jacobs & Viechtbauer, 2017).

  • transf.dtorbis: transformation of standardized mean differences to biserial correlations. Like transf.dtorpb, but the point-biserial correlations are then transformed to biserial correlations with \mjeqnr_bis = \frac\sqrtp(1-p)f(z_p) r_pbr_bis = sqrt(p*(1-p)) / f(z_p) r_pb, where \mjeqnp = \fracn_1n_1+n_2p = n1/(n1+n2) and \mjseqnf(z_p) denotes the density of the standard normal distribution at value \mjseqnz_p, which is the point for which \mjseqnP(Z > z_p) = p, with \mjseqnZ denoting a random variable following a standard normal distribution (Jacobs & Viechtbauer, 2017).

  • transf.rpbtorbis: transformation of point-biserial correlations to biserial correlations. Argument pi 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). If pi is not specified, the function assumes pi=0.5, which corresponds to dichotomization at the median. The transformation is carried out as described for transf.dtorbis.

  • transf.rtorpb: transformation of Pearson product-moment correlations to the corresponding point-biserial correlations, when one of the two variables is dichotomized. Argument pi 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). If pi is not specified, the function assumes pi=0.5, which corresponds to dichotomization at the median. This function is simply the inverse of transf.rpbtorbis.

  • transf.rtod: transformation of Pearson product-moment correlations to the corresponding standardized mean differences, when one of the two variables is dichotomized. Arguments n1i and n2i can be used to denote the number of individuals in the first and second group created by the dichotomization. If n1i and n2i are not specified, the function assumes n1i = n2i. This function is simply the inverse of transf.dtorbis.

  • transf.rpbtod: transformation of point-biserial correlations to standardized mean differences. This is simply the inverse of transf.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 the pc 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 the pc 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 \mjseqnh(z) is given by \mjsdeqn\int_\textrmlower^\textrmupper h(z) f(z) dz using the limits targs$lower and targs$upper, where \mjseqnf(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)

metafor documentation built on May 29, 2024, 7:44 a.m.