Effect Size Calculator

David B. Wilson, PhD, George Mason University
Version date: 2023.11.27

1 The Standardized Mean Difference: Cohen’s \(d\) and Hedges’ \(g\)

The standardized mean difference effect size is appropriate for meta-analyses where the independent variable is binary and the dependent variable is typically scaled or continuous. However, methods are provided below for estimating the standardized mean difference effect size from a binary dependent variable. The binary independent variable is often treatment versus control but it can be any dichotomous independent variable of interest, including observed variables rather than manipulated variables.

1.1 Canonical form (means and standard deviations)

The canonical form of the standardized mean difference effect size is based on means, standard deviations, and sample sizes. The equation for Cohen’s \(d\) is \[ d = \frac{\overline{x}_1 - \overline{x}_2}{s_{pooled}} ~, \] where \(\overline{x}_1\) is the treatment group mean and \(\overline{x}_2\) is the control group mean. The pooled within groups standard deviation (\(s_{pooled}\)) is computed as \[ s_{pooled} = \sqrt{ \frac{ s_1^2 \left( n_1-1 \right) + s_2^2 \left( n_2-1 \right) } { n_1 + n_2 - 2 } } ~, \] where \(s_1\) and \(s_2\) are the respective standard deviations, and \(n_1\) and \(n_2\) are the respective sample sizes.

The variance of \(d\) is \[ v_d = \left( \frac{n_1 + n_2}{n_1n_2} \right) + \left(\frac{d^2}{2(n_1+n_2)} \right) ~, \] and thus the standard error is \[ se_d = \sqrt{v_d} ~. \]

Hedges’ \(g\) is Cohen’s \(d\) with a small sample size bias correction applied. The precise correction uses the gamma function but a close approximation is easily computed as \[ j = 1 - \left( \frac{3}{4(n_1+n_2-2)-1} \right) . \] Using this correct and Cohen’s \(d\), we can compute Hedges’ \(g\) as \[ g = d \cdot j ~, \] and the associated variance and standard error as \[ v_g = v_d \cdot j^2 ~, \] \[ se_g = \sqrt{se_g} ~. \]

Confidence intervals can be computed in the usual way based on the effect size and its associated standard error using the normal probability distribution. For a 95% confidence interval, we use a \(z\) associated with a two-tail .05 critical value, or \(z = 1.959964\). The confidence intervals are compute as \[ d_{lower} = d - z \cdot se_d, \\ d_{upper} = d + z \cdot se_d ~. \] The confidence intervals for Hedges’ \(g\) are computed in the same fashion: \[ g_{lower} = g - z \cdot se_g, \\ g_{upper} = g + z \cdot se_g ~. \]

1.2 Means and standard errors

Standard errors can be converted into standard deviations so long as you know the sample size on which the standard error was based. The conversion is \[ s = se \cdot \sqrt{n} ~. \] The computation of effect sizes proceeds as with the canonical case.

1.3 Means and full sample standard deviation

The pooled within groups standard deviation (\(s_{pooled}\)) can be computed from the full sample standard deviation. The equation uses the sample sizes and group means to compute the variance between groups and removes that from the overall variance to get the variance within groups. The equation is \[ s_{pooled} = \sqrt{ \left( \frac{n-1}{n-2} \right)s^2 - \frac{ \left( \overline{x}_1 - \overline{x}_2 \right)^2n_1n_2}{n(n-2)}} \] where \(s\) is the full sample standard deviation and \(n\) is \(n_1+n_2\).

The computation of effect sizes proceeds as with the canonical case.

1.4 Means and standard deviations from clustered designs

This method implements the What Works Clearinghouse approach to computing Cohen’s \(d\) and Hedges’ \(g\) from clustered designs.

The small sample size bias correction for Hedges’ \(g\) incorporates the intra-class correlation (\(p\)), the total sample size (\(n\)), and the number of clusters (\(m\)). It is computed as \[ j = 1 - \left( \frac{3}{4h-1} \right), \] where \(h\) is \[ h =\frac{\left[ (n - 2)-2\left(\frac{n}{m}-1\right)p\right]^2}{(n-2)(1-p)^2+\frac{n}{m}\left(n-2\frac{n}{m}\right)p^2 + 2\left(n-2\frac{n}{m}\right)p(1-p)} ~. \]

Cohen’s \(d\) is computed as \[ d = \left(\frac{\overline{x}_1 - \overline{x}_2}{s_{pooled}}\right) \sqrt{\lambda} ~, \] where \(s_{pooled}\) is computed as with the canonical case and \(\lambda\) is computed as \[ \lambda = 1 - \frac{2(\frac{n}{m})p}{n - 1} ~. \]

Hedges’ \(g\) is computed as \[ g = j \cdot d \cdot \sqrt{\lambda} ~. \]

The standard error and variance of these effect sizes can be computed either from the effect sizes and sample sizes or from the standard error from an HLM type model. The latter takes into account covariates incorporated into the model but assumes that the mean difference used in the above equations equals the unstandardized regression coefficient for the treatment dummy variable associated with the standard error.

The variance for Cohen’s \(d\) and Hedges’ \(g\) based on the effect size and sample sizes are \[ v_d = \left(\frac{n_1 + n_2}{n_1n_2}\right)\left[1+(n-1)p\right]+\left( \frac{d^2}{2h}\right) ~, \] and \[ v_g = j^2 \left(\frac{n_1 + n_2}{n_1n_2}\right)\left[1+(n-1)p\right]+\left( \frac{g^2}{2h}\right) ~. \]

The variance for Cohen’s \(d\) and Hedges’ \(g\) based on the standard error (\(s_b\)) from an HLM regression model are \[ v_d = \lambda \left(\frac{s_b}{s_{pooled}}\right)^2 + \frac{d^2}{2h} ~, \] and \[ v_g = j^2 \lambda \left(\frac{s_b}{s_{pooled}}\right)^2 + \frac{g^2}{2h} ~. \]

1.5 Means with subgroups

This method calculates a weighted mean across subgroups within the treatment and control conditions. It also calculates the standard deviation within each condition by first pooling the sum-of-squares within subgroups, then computing the sum-of-squares across means, and finally adding these to determine the overall, within condition, standard deviation.

The weighted means are computed using \[ \overline{x} = \frac{\sum \overline{x}_j n_j}{\sum n_j} \] where \(j\) is an index for the subgroups.

The sum-of-squares within is computed as \[ SS_{within} = \sum s_j^2(n_j-1) ~. \]

The sum-of-squares between the means within condition is computed as \[ SS_{between} = \sum \overline{x}_j^2 n_j - \frac{(\sum \overline{x}_j n_j)^2}{\sum n_j} ~, \]

The standard deviation for each condition is calculated as \[ s = \sqrt{ \frac{SS_{between}+SS_{within}}{n-1} } ~. \]

Cohen’s \(d\) and Hedges’ \(g\) are then computed as with the canonical case.

1.6 Means and standard deviations with pretests

This method computes a difference-in-differences Cohen’s \(d\) and Hedges’ \(g\) effect size. The numerator is simply the difference-in-differences. However, there are three possibilities for the denominator, or pooled within groups standard deviation. The first is based on the pretest standard deviations, the second on the post-test standard deviations, and the third uses both the pretest and post-test standard deviations. The first of these is the default based on work by Morris [Morris, S. B. (2008). Estimating effect sizes from pretest-posttest-control group designs. Organizational research methods, 11(2), 364-386.].

Cohen’s \(d\) is computed as \[ d = \frac{\overline{\Delta}_1 - \overline{\Delta}_2}{s_{pooled}} ~, \] where \(\overline{\Delta}\) is the post-test minus the pretest means, \[ \overline{\Delta} = \overline{x}_{post-test} - \overline{x}_{pretest} ~. \]

Hedges’ \(g\) is computed as \[ g = j \cdot \frac{\overline{\Delta}_1 - \overline{\Delta}_2}{s_{pooled}} ~, \] where \(j\) is compute as with the canonical method.

The pooled within groups standard deviation based on pretest standard deviations is \[ s_{pooled} = \sqrt{ \frac{ {s_1}_{pretest}^2 \left( n_1-1 \right) + {s_2}_{pretest}^2 \left( n_2-1 \right) } { n_1 + n_2 - 2 } } ~. \]

The pooled within groups standard deviation based on post-test standard deviations is \[ s_{pooled} = \sqrt{ \frac{ {s_1}_{post-test}^2 \left( n_1-1 \right) + {s_2}_{post-test}^2 \left( n_2-1 \right) } { n_1 + n_2 - 2 } } ~. \]

The pooled within groups standard deviation based on pretest and post-test standard deviations is \[ s_{pooled} = \sqrt{ \frac{ {s_1}_{pretest}^2 \left( n_1-1 \right) + {s_1}_{post-test}^2 \left( n_1-1 \right) + {s_2}_{pretest}^2 \left( n_2-1 \right) + {s_2}_{post-test}^2 \left( n_2-1 \right) } { 2(n_1 + n_2 - 2) } } ~. \]

The standard error and variance for this effect size depends on the correlation between the pretest and post-test. A default value of 0.50 is assumed by this calculator but can be changed if the actual correlation is known. Additionally, this correlation within each condition can be recovered from a paired t-test between the pretest and post-test means. The equation for this is based on pretest and post-test means for a single group is shown below: \[ r = \frac {\left(s_{pretest}^2 t^2 + s_{post-test}^2 t^2 \right) - \left(\overline{X}_{post-test} - \overline{X}_{pretest}\right)^2 n} {2 s_1 s_2 t^2} \] The equation for this is based on the mean gain score within a group is shown below: \[ r = \frac {\left(s_{pretest}^2 t^2 + s_{post-test}^2 t^2 \right) - \Delta^2 n} {2 s_1 s_2 t^2} \]

The variance of Cohen’s \(d\) is \[ v_d = 2(1-r) \left(\frac{n_1+n_2}{n_1 n_2}\right) \left[\frac{n_1+n_2-2}{n_1+n_2-4} \right] \left[1 + \frac{d^2}{2(1-r)\left(\frac{n_1+n_2}{n_1n_2}\right)} \right] - \frac{d^2}{j^2} \]

The variance of Hedges’ \(g\) is \[ v_g = v_d \cdot j^2 \]

1.7 Mean gain scores (change scores, difference scores) and gain score standard deviations

This method assumes that you are working from gain scores (change scores, difference scores) that reflect the mean of the post-test minus the pretest. Typically, such studies will report the standard deviation of the gain scores. To compute Cohen’s \(d\) or Hedges’ \(g\) this standard deviation of gain scores must be converted to a standard deviation of raw scores within each condition. This is done as follows: \[ s = \sqrt{ s_{gain}(2(1-r)) } ~, \] where \(r\) is the correlation between the pretest and post-test scores. If this is unknown, a guestimate may be used, such a 0.50, but it is important to note that this affects both the effect size and the estimated variance. The pooled within groups standard deviation (\(s_{pooled}\)) is computed using \(s\) above and the canonical equation.

Cohen’s \(d\) is computed as \[ d = \frac{\overline{\Delta}_1 - \overline{\Delta}_2}{s_{pooled}} ~, \] where \(\overline{\Delta}\) is the mean gain score.

Hedges’ \(g\) is computed as \[ g = j \cdot \frac{\overline{\Delta}_1 - \overline{\Delta}_2}{s_{pooled}} ~, \] where \(j\) is compute as with the canonical method.

The variance of Cohen’s \(d\) is \[ v_d = 2(1-r) \left(\frac{n_1+n_2}{n_1 n_2}\right) \left[\frac{n_1+n_2-2}{n_1+n_2-4} \right] \left[1 + \frac{d^2}{2(1-r)\left(\frac{n_1+n_2}{n_1n_2}\right)} \right] - \frac{d^2}{j^2} \]

The variance of Hedges’ \(g\) is \[ v_g = v_d \cdot j^2 \]

1.8 Mean gain scores (change scores, difference scores) and pretest and post-test standard deviations

In rare cases a study might report mean gain scores but report the standard deviations separately for the pretest and post-test. In such cases, the effect size is calculated using the same equations as for “Means and standard deviations with pretests”.

1.9 \(t\)-test with unequal \(N\)s

Cohen’s \(d\) and Hedges’ \(g\) can be calculated from an independent \(t\)-test comparing two means. This method is for situations where the \(n\)’s are unequal between conditions. Cohen’s \(d\) is computed as \[ d = t \sqrt{\frac{n_1+n_2}{n_1n_2}} ~. \]

Hedges’ \(g\) is computed as \[ g = j \cdot t \sqrt{\frac{n_1+n_2}{n_1n_2}} ~. \]

The variance and standard errors are computed as with the canonical method.

1.10 \(t\)-test with equal \(N\)s

Cohen’s \(d\) and Hedges’ \(g\) can be calculated from an independent \(t\)-test comparing two means. This method is for situations where the \(n\)’s are equal between conditions. Cohen’s \(d\) is computed as \[ d = \frac{2t}{\sqrt{n_1+n_2}} ~. \]

Hedges’ \(g\) is computed as \[ g = j \cdot \frac{2t}{\sqrt{n_1+n_2}} ~. \]

The variance and standard errors are computed as with the canonical method.

1.11 \(t\)-test \(p\)-value with equal or unequal \(n\)’s

A Cohen’s \(d\) and Hedges’ \(g\) effect size can be obtained from an exact \(p\)-value from an independent \(t\)-test comparing two means. The precision of the effect size will be affected by the precision of the \(p\)-value. The method uses an inverse probability distribution function for the Student’s \(t\) to determine the \(t\)-value associated with the \(p\)-value and its degrees of freedom, where the degrees of freedom are \[ \textrm{df} = N - 2 = n_1 + n_2 - 2 ~. \]

This calculator uses Javascript inverse distribution functions written by John C. Pezzullo. The equations are iterative and are not reproduced here. However, inverse distribution functions are built into most statistical software packages. Below are examples of how to obtain a \(t\)-value from a \(p\)-value and associated df with R, Stata, SPSS, and Excel. In all cases it is assumed that these are two-tailed \(p\)-values.

* R: abs(qt(p/2,df))
* Stata: abs(invt(df,p/2))
* SPSS: abs(idf.t(p/2,df))
* Excel: INVT(p,df)

Cohen’s \(d\) and Hedges’ \(g\) are then computed using the method for \(t\)-tests.

1.12 Oneway \(F\)-test with two means, unequal and equal \(N\)s

Cohen’s \(d\) and Hedges’ \(g\) can be calculated from a oneway ANOVA (\(F\)-test) comparing two means. Note that this method only works for \(F\)-values with df \(=1\) in the numerator. For unequal \(N\)s, Cohen’s \(d\) is computed as \[ d = \sqrt{\frac{F(n_1+n_2)}{(n_1 \cdot n_2)}} ~, \] whereas for equal \(N\)s it is computed as \[ d = \sqrt{\frac{F}{N}} ~. \]

Hedges’ \(g\) is computed as \[ g = j \cdot d ~. \]

The standard error/variance are computed as with the canonical case.

1.13 Oneway \(F\)-test with three or more means

This method uses the \(F\)-value from a oneway ANOVA and the variability across the means to determine the mean square between. The square-root of the mean square between is the pooled within groups standard deviation. The ratio of \(F\) over the mean square between is the mean square error. This method requires the means and sample sizes for all groups that contributed to \(F\). The mean square between is calculated as \[ \textrm{MS}_{between} = \frac{\sum (\overline{x}_j n_j)^2 + \frac{\left( \sum \overline{x}_j n_j \right)^2}{\sum n_j}}{k - 1} ~, \] where \(j\) is an index for each condition or group and \(k\) is the number of groups. Using this result, the pooled within groups standard deviation is computed as \[ s_{pooled} = \sqrt{\frac{\textrm{MS}_{between}}{F} } ~. \]

This \(s_{pooled}\) is then used to compute Cohen’s \(d\) and Hedges’ \(g\) using the canonical method and the means selected via radio buttons for the treatment and control conditions. If multiple conditions are selected for either the treatment or control conditions, then the method for means with subgroups is used.

1.14 ANCOVA: Analysis of variance with a covariate

This method is appropriate for an ANOVA model with a single binary (treatment vs. control) factor variable and a single covariate, such as a pretest of the outcome (dependent variable). The method requires knowledge of the correlation between the covariate and the dependent variable. The pooled within group standard deviation is computed as \[ s_{pooled} = \sqrt{\left[\frac{\textrm{MS}_{error}}{1-r^2} \right] \left[ \frac{\textrm{df}_{error}-1}{\textrm{df}_{error}-2} \right]} ~, \] where \(r\) is the correlation between the covariate and the dependent variable and the \(\textrm{df}_{error}\) is \[ \textrm{df}_{error} = n_1 + n_2 - 3 ~. \]

Using the above \(s_{pooled}\), Cohen’s \(d\) and Hedges’ \(g\) are compute as with the canonical case.

1.15 ANOVA: Two-way analysis of variance

This method is appropriate for an ANOVA with two categorical factors (independent variables). One of these must be a binary factor reflecting the treatment versus control contrast. The method requires knowledge of the means in the treatment and control conditions (the marginal means) and the mean square error. Typically, if this information is provided, so are the standard deviations and the canonical method can be used. However, in a case where the standard deviations are not reported, this method will recover the standardized mean difference effect size. There is an option for including or excluding the variability associated with the non-treatment contrast factor into the pooled within groups standard deviation. You would want to do this if the non-treatment contrast factor was a characteristic of the participants, such as risk-level or gender. You would likely not want to do this if the non-treatment contrast factor was a manipulated factor (experimental), although that may depend on context. The default is to include this variability. In the equations below, \(A\) indicates the treatment vs. control factor and \(B\) indicates the other factor.

The pooled within groups standard deviation is computed as follows: \[ \textrm{df}_{total} = n_1 + n_2 - 1 ~, \] \[ \textrm{df}_{A} = 1 ~, \] \[ \textrm{df}_{AB} = \textrm{df}_{A}\cdot\textrm{df}_{B} ~, \] where \(\textrm{df}_{B}\) is the degrees-of-freedom for the non-treatment condition factor, \[ \textrm{df}_{error} = \textrm{df}_{total} - (\textrm{df}_{A} +\textrm{df}_{B} +\textrm{df}_{AB}) ~, \] \[ \textrm{SS}_{A} = F_A\cdot\textrm{MS}_{error} \cdot \textrm{df}_A ~. \] \[ \textrm{SS}_{B} = F_B\cdot\textrm{MS}_{error} \cdot \textrm{df}_B ~. \] \[ \textrm{SS}_{AB} = F_{AB}\cdot\textrm{MS}_{error} \cdot \textrm{df}_{AB} ~. \] and \[ \textrm{SS}_{error} = \textrm{MS}_{error}\cdot\textrm{df}_{error} ~. \] If the variability associated with factor B is to be added to the pooled within groups standard deviation, then it is computed as \[ s_{pooled} = \sqrt{\frac{\textrm{ss}_B+\textrm{ss}_{AB}+\textrm{ss}_{error}} {\textrm{df}_B+\textrm{df}_{AB}+\textrm{df}_{error}}} ~. \] If the variability associated with factor B is NOT to be added to the pooled within groups standard deviation, then it is computed as \[ s_{pooled} = \sqrt{\frac{\textrm{ss}_{AB}+\textrm{ss}_{error}} {\textrm{df}_{AB}+\textrm{df}_{error}}} ~. \]

Using the above \(s_{pooled}\), Cohen’s \(d\) and Hedges’ \(g\) are compute as with the canonical case.

1.16 Binary dependent variable: a 2-by-2 frequency table

Three different methods are provided below for estimating a standardized mean difference effect size from a binary dependent variable. All three produce similar results in most situations—differences between methods increase as the event rate approaches 0 or 1. The first two (designated as the logit and the Cox logit methods) are based on a conversion of the logged odds ratio. The logic of this is based on the similarity of the logistic and standardized normal distributions. The former has a mean of zero and a standard deviation of \(\pi / \sqrt{3}\), whereas the latter has a mean of zero and a standard deviation of 1. The shapes are similar but not identical, with the logistic distribution being somewhat leptokurtic. The logit method simply re-scales the logged odds ratio based on the difference between the standard deviations for these two distributions. The Cox method tweaks the conversion to account for the leptokurtic nature of the logistic distribution, improving the performance of the conversion when the event rate approaches 0 or 1. The probit method is based entirely on the normal distribution. This approach finds the \(z\) associated with the area under the left portion of the curve that equals the proportion experiencing the event for each group. For example, a success rate (or failure rate) of .50 would correspond with a \(z\) of 0 (half of the distribution is to the left of 0). Similarly, a success rate of .025 would correspond to a \(z\) of -1.96. This value is called the probit of a proportion. The standardized mean difference effect size is computed as the difference between these two probits. Each of these methods has a specific equation for its standard error and variance.

The logit and Cox logit methods start by computing the logged odds ratio, where \(a\), \(b\), \(c\), and \(d\) are the cell frequencies of a 2-by-2 contingency table. \[ \textrm{logged}_{\textrm{OR}} = \textrm{log} \left( \frac{a\cdot d}{b\cdot c} \right) ~. \]

For the logit method, Cohen’s \(d\) is computed as \[ d = \textrm{logged}_{\textrm{OR}} \cdot \frac{\sqrt{3}}{\pi} = \textrm{logged}_{\textrm{OR}} \cdot 0.551 ~. \]

For the Cox logit method, Cohen’s \(d\) is computed as \[ d = \frac{\textrm{logged}_{\textrm{OR}}}{1.65} ~. \]

The variance of \(d\) for the logit method is \[ v_d = \left[ \frac{1}{a}+ \frac{1}{b}+ \frac{1}{c}+ \frac{1}{d} \right] \cdot \left[ \frac{3}{\pi^2}\right] = \left[ \frac{1}{a}+ \frac{1}{b}+ \frac{1}{c}+ \frac{1}{d} \right] \cdot 0.367 ~. \] The variance of \(d\) for the Cox logit method is \[ v_d = \left[ \frac{1}{a}+ \frac{1}{b}+ \frac{1}{c}+ \frac{1}{d} \right] \cdot \left[ \frac{3}{\pi^2}\right] = \left[ \frac{1}{a}+ \frac{1}{b}+ \frac{1}{c}+ \frac{1}{d} \right] \cdot 0.304 ~. \]

Note that the above becomes undefined if any of the four cell frequencies equals zero. To avoid this, \(.5\) is added to all cell frequencies if any cell frequency equals zero.

The probit method computes \(d\) as \[ z_1 = \textrm{probit}\left(p_1\right) ~, \] \[ z_2 = \textrm{probit}\left(p_2\right) ~, \] and finally \[ d = z_1 - z_2 ~. \]

The variance of \(d\) using for the probit method is \[ v_d = \frac{2 \pi p_1 \left( 1 - p_1 \right) e^{z_1^2}}{n_1} + \frac{2 \pi p_2 \left( 1 - p_2 \right) e^{z_2^2}}{n_2} ~. \]

The calculator determines the probit using an inverse distribution function for the standardized normal distribution written by John C. Pezzullo. The probit (\(z\)) can be determine for any proportion in R, Stata, and SPSS as follows:

* R: abs(qnorm(p))
* Stata: abs(invnormal(p/2))
* SPSS: abs(idf.normal(p/2,0,1))
* Excel: ABS(NORM.INV(p/2,0,1))

Hedges’ \(g\) and the variance of Hedges’ \(g\) are computed as with the canonical case for each of the above three methods.

1.17 Binary dependent variable: Proportions within each condition

This method uses the sample sizes and proportions to recreate the 2-by-2 frequency table, at least to within rounding error. It then uses the method for 2-by-2 frequencies tables to compute Cohen’s \(d\) and Hedges’ \(g\). The cells of the 2-by-2 table are computed as \[ a = p_1 \cdot n_1 \] \[ b = (1-p_1) \cdot n_1 \] \[ c = p_2 \cdot n_2 \] \[ d = (1-p_2) \cdot n_2 \]

1.18 Binary dependent variable: Percents within each condition

This method uses the sample sizes and percents to recreate the 2-by-2 frequency table, at least to within rounding error. It then uses the method for 2-by-2 frequencies tables to compute Cohen’s \(d\) and Hedges’ \(g\). The cells of the 2-by-2 table are computed as \[ a = p_1/100 \cdot n_1 \] \[ b = (1-p_1)/100 \cdot n_1 \] \[ c = p_2/100 \cdot n_2 \] \[ d = (1-p_2)/100 \cdot n_2 \]

1.19 Binary dependent variable: 2-by-2 vrequency table with pretest data

This method approximates Cohen’s \(d\) and Hedges’ \(g\) from binary or dichotomous outcome data using the frequencies of a 2-by-2 contingency table for the pretest and post-test. The method produces a difference-in-differences effect size estimate. Two computational methods are provided, the logit method and the Cox logit method. If any cell of the 2-by-2 equals zero, .5 is added to all cells. Enter the correlation between the pretest/post-test values if it is known. If it is unknown, a default value of 0.50 will be used. This value does not affect the effect size but does affect the standard error and variance. As such, the standard error is an approximation when the correlation is unknown. For a robust standard error estimator, set the correlation to 0 (this reproduces the standard error for the treatment effect from a difference-in-differences GEE logistic regression model).

Cohen’s \(d\) for the logit and Cox logit methods are computed as \[ d_{logit} = {d_{logit}}_{post-test} - {d_{logit}}_{pretest} ~, \] and \[ d_{Cox} = {d_{Cox}}_{post-test} - {d_{Cox}}_{pretest} ~, \] where \(r\) is the correlation between the pretest and post-test. The variance of Cohen’s \(d\) for the logit and Cox logit methods are computed as \[ {v_d}_{logit} = {v_{d_{logit}}}_{post-test} + {v_{d_{logit}}}_{pretest} - 2 (r \cdot {v_{d_{logit}}}_{post-test} \cdot {v_{d_{logit}}}_{pretest} ) ~, \] and \[ {v_d}_{Cox} = {v_{d_{Cox}}}_{post-test} + {v_{d_{Cox}}}_{pretest} - 2 (r \cdot {v_{d_{Cox}}}_{post-test} \cdot {v_{d_{Cox}}}_{pretest} ) ~. \]

The Hedges’ \(g\) version of the above have the small sample size bias correction applied.

1.20 Binary dependent variable: Proportions within each condition with pretest data

This method uses the sample sizes and proportions to recreate the post-test and pretest 2-by-2 frequency table, at least to within rounding error. It then uses the method for 2-by-2 frequencies tables with pretest data to compute Cohen’s \(d\) and Hedges’ \(g\). The equations are the same as for binary proportions without pretest data.

1.21 Binary dependent variable: Percents within each condition with pretest data

This method uses the sample sizes and percents to recreate the post-test and pretest 2-by-2 frequency table, at least to within rounding error. It then uses the method for 2-by-2 frequencies tables with pretest data to compute Cohen’s \(d\) and Hedges’ \(g\). The equations are the same as for binary percents without pretest data.

1.22 Binary dependent variable: Chi-square based on 2-by-2 data

This method converts a chi-square into Cohen’s \(d\) and Hedges’ \(g\). The chi-square must be based on a 2-by-2 contingency table and as such have 1 degree of freedom. Chi-squares from larger contingency tables are not appropriate for this method. This should also be used as a method of last resort. Working directly from the frequencies, proportions, or percents provides a better estimate of the effect size. The equation for Cohen’s \(d\) is \[ d = 2 \sqrt{\frac{\chi^2}{(n_1+n_2)-\chi^2}} ~, \] and the variance is \[ v_d = \frac{d^2}{\chi^2} ~. \] Hedges’ \(g\) and its variance are computed in the usual way: \[ g = d \cdot j ~, \] and \[ v_g = v_d \cdot j^2 ~. \]

1.23 Binary dependent variable: \(p\)-value from a chi-square based on 2-by-2 data

The chi-square associated with an exact \(p\)-value and associated degrees of freedom can be determined using the inverse probability distribution for the chi-square. This method uses a Javascript function for this written by John C. Pezzullo. You can reproduce these result using the functions built into R, Stata, SPSS, or Excel, as shown below.

* R: qchisq(1-p,df)
* Stata: invchi2(df,1-p)
* SPSS: idf.ch2(1-p,df)
* Excel: CHISQ.INV(1-p,df)

Cohen’s \(d\) and Hedges’ \(g\) are then computed using the method for a chi-square from 2-by-2 data.

1.24 Ordinal distribution by group using cell frequencies

A study may report the frequency distribution for each group or condition across levels of an ordinal variable. The method below computes a mean and standard deviation for each condition by assigning 0, 1, 2, etc. to the levels of the ordinal scale. Because the effect size is standardized, these values are arbitrary. However, this method is assuming equal intervals across levels of the ordinal variable. The mean within each group (\(j\)) is computed as \[ \overline{x} = \frac{\sum_{i = 0}^k i \cdot f_i}{\sum_{i = 0}^k f_i } ~. \] where \(k\) is the number of levels of the ordinal variable. The standard deviation is computed as \[ s = \sqrt{\frac{\sum_{i = 0}^k i^2 \cdot f_i - \frac{\left( {\sum_{i = 0}^k i \cdot f_i } \right)^2 }{\sum_{i = 0}^k f_i }}{\sum_{i = 0}^k f_i -1 }} ~. \]

Cohen’s \(d\) and Hedges’ \(g\) are then computed as with the canonical method using the above means and standard deviations computed separately for the treatment and control conditions.

1.25 Ordinal distribution by group using cell proportions

The method is the same as the method for ordinal distributions using cell frequencies except that the cell frequencies are estimate from the cell proportions and condition sample size, as shown below: \[ f_i = p_i \cdot n ~, \] where \(p_i\) is the cell proportion and \(n\) is the associated sample size.

1.26 Correlation (point-biserial) with unequal \(N\)s

A point-biserial correlation is a correlation between a binary variable (such as treatment versus control) and a scaled or continuous variable. This correlation can be calculated using either the standard Pearson’s correlation coefficient equation or the point-biserial correlation coefficient equation. When the treatment and control \(N\)s are unequal, such a correlation can be converted to Cohen’s \(d\) as shown below: \[ d = \frac{r}{\sqrt{(1-r^2)\left[\left(\frac{n_1}{n_1+n_2}\right)\left(1 - \frac{n_1}{n_1+n_2} \right) \right]}} \] Using the above, the variance is computed using the canonical equations as are Hedges’ \(g\) and its variance.

1.27 Correlation (point-biserial) with equal \(N\)s

A point-biserial correlation is a correlation between a binary variable (such as treatment versus control) and a scaled or continuous variable. This correlation can be calculated using either the standard Pearson’s correlation coefficient equation or the point-biserial correlation coefficient equation. When the treatment and control \(N\)s are equal, such a correlation can be converted to Cohen’s \(d\) as shown below: \[ d = \frac{2r}{\sqrt{1-r^2}} ~. \] Using the above, the variance is computed using the canonical equations as are Hedges’ \(g\) and its variance.

1.28 Correlation \(p\)-value (point-biserial with equal or unequal \(N\)s)

A \(p\)-value associated with a correlation between a binary variable (such as treatment versus control) and a scaled or continuous variable is equivalent to a \(p\)-value from an independent \(t\)-test comparing two means.

A Cohen’s \(d\) and Hedges’ \(g\) effect size can be obtained from such a \(p\)-value, the precision of which will depend on the precision of the \(p\)-value. The method uses an inverse probability distribution function for the Student’s \(t\) to determine the \(t\)-value associated with the \(p\)-value and its degrees of freedom, where the degrees of freedom are \[ \textrm{df} = N - 2 = n_1 + n_2 - 2 ~. \]

This calculator uses Javascript inverse distribution functions written by John C. Pezzullo. The equations are iterative and are not reproduced here. However, inverse distribution functions are built into most statistical software packages. Below are examples of how to obtain a \(t\)-value from a \(p\)-value and associated df with R, Stata, SPSS, and Excel. In all cases it is assumed that these are two-tailed \(p\)-values.

* R: abs(qt(p/2,df))
* Stata: abs(invt(df,p/2))
* SPSS: abs(idf.t(p/2,df))
* Excel: INVT(p,df)

Cohen’s \(d\) and Hedges’ \(g\) are then computed using the method for \(t\)-tests.

1.29 Correlation (phi coefficient)

A phi correlation coefficient is a correlation between two binary variables, such as treatment versus control and a binary (yes/no) dependent variable. The phi coefficient can be computed from a 2-by-2 frequency table or from dummy-coded data using Pearson’s formula. A phi coefficient can be converted into Cohen’s \(d\) as \[ d = \frac{2r}{\sqrt{1 - r^2}} ~. \] The variance of Cohen’s \(d\) based on a phi coefficient is \[ v_d = \frac{d^2}{\chi^2} ~, \] where \[ \chi^2 = r^2 \cdot (n_1 + n_2) ~. \]

Hedges \(g\) and its variance are computed as \[ g = d \cdot j ~, \] and \[ v_g = v_d \cdot j^2 ~. \]

This method should only be used if you do not have the 2-by-2 frequency data (or the proportion/percents of successes/failures within each condition). The latter allow you to use the logit, Cox logit, or probit methods of approximating \(d\) and \(g\) and simulations suggest that these methods are superior to the above approximation based on the phi-coefficient.

1.30 Correlation \(p\)-value (phi coefficient)

A \(p\)-value for a phi coefficient or correlation between two binary variables can be used to estimate \(d\) and \(g\). The method determines the phi coefficient associated with the \(p\) value and by first determining the \(p\)-values corresponding chi-square using the inverse probability distribution function. The method for “correlation (phi coefficient)” is then used.

This calculator uses Javascript inverse distribution functions written by John C. Pezzullo. Below are examples of how to obtain a \(\chi^2\)-value from a \(p\)-value and associated df with R, Stata, SPSS, and Excel. In all cases it is assumed that these are two-tailed \(p\)-values. For a phi coefficient, the degrees of freedom for the chi-square is equal to 1.

* R: qchisq(1-p,1)
* Stata: invchi2(1,1-p)
* SPSS: idf.ch2(1-p,1)
* Excel: CHISQ.INV(1-p,1)

1.31 OLS regression coefficient, unstandarized

This method computes Cohen’s \(d\) and Hedges’ \(g\) from an unstandardized regression coefficient from an OLS model. It assumes the regression coefficient is for a dummy code (a 1/0 variable) reflecting the contrast between the treatment and control conditions. This method is unsuitable for a regression coefficient associated with a scaled independent variable. Two methods of estimating the standard error and variance are provided. The first is based on the standard error of the regression coefficient and ensures that the \(p\)-value for the effect size is consistent with the \(p\)-value for the regression coefficient. The second is based on the effect size and sample size using the canonical equation for the standard error of Cohen’s \(d\) and Hedges’ \(g\). In most cases, the first method is preferred as it accounts for the covariates in the regression model.

Cohen’s \(d\) based on an unstandardized regression coefficient is computed as \[ d = \frac{B}{s_{pooled}} ~, \] where \(s_{pooled}\) is \[ s_{pooled} = \sqrt{ \frac{s_y^2[(n_1+n_2) - 1] - \left( \frac{B^2(n_1*n_2)} {(n_1+n_2)} \right)}{n_1+n_2-2} } ~, \] where \(s_y\) is the standard deviation of the dependent variable. Note that this equation removes from variability associated with the treatment effect from the total variability, thus producing the pooled within groups standard deviation.

The variance of \(d\) based on the standard error of \(B\) is computed as \[ v_d = \left(\frac{d \cdot B}{se_B}\right)^2 ~. \] The above equation assumes that both \(d\) and \(B\) have the same sign.

Hedges’ \(g\) and its variance based on the standard error of \(B\) are \[ g = d \cdot j ~. \] and \[ v_g = \left(\frac{g \cdot B}{se_B}\right)^2 ~. \] The above equation assumes that both \(g\) and \(B\) have the same sign.

The variance and standard error of \(d\) and \(g\) based on sample sizes and effect sizes rather than the standard error of B uses the canonical equations.

1.32 OLS regression coefficient, standarized

This method computes Cohen’s \(d\) and Hedges’ \(g\) from a standardized regression coefficient from an OLS model. See note for computing \(d\) and \(g\) from an unstandardized regression coefficient. The first step in computing \(d\) is to convert the standardized regression coefficient (\(\beta\)) into a semi-standardized coefficient (i.e., unstandardizing on the independent variable, \(x\)) using the following equation: \[ B = \frac{\beta}{s_x} ~, \] where \(s_x\) is \[ s_x = \sqrt{ \frac{n_1 - \frac{n_1^2}{n_1+n_2}}{n_1+n_2} } \] (Note that one would swap \(n_1\) and \(n_2\) and obtain the same result.)

From this point, the method for an unstandardized OLS regression coefficient is used with a \(s_y = 1\).

1.33 Logistic regression coefficient

A logistic regression coefficient (\(B\)) is a logged odds ratio. This method assumes that the independent variable is binary, that is, is a dummy code for treatment versus control. As a logistic regression model, the dependent variable is also, of course, binary. This method converts the logged odds ratio into Cohen’s \(d\) and Hedges’ \(g\) using the logit and Cox logit methods, as shown below.

The logit method is \[ d = B \cdot \frac{\sqrt{3}}{\pi} ~, \] whereas the Cox logit method is \[ d = \frac{B}{1.65} ~. \]

The corresponding variances of \(d\) based on the standard error of the logistic regression coefficient are computed as \[ v_d = se_B^2 \cdot \frac{3}{\pi^2} ~ \] and \[ v_d = \frac{se_B^2}{1.65^2} ~. \]

Hedges’ \(g\) is computed by applying the small sample size bias correction \(j\), as shown below: \[ g = d \cdot j ~. \] and \[ v_g = v_d \cdot j^2 ~. \]

1.34 Regression coefficient from an HLM/mixed effects model (clustered data)

This method computes Cohen’s \(d\) and Hedges’ \(g\) from an unstandardized regression coefficient from a multilevel model (e.g., HLM, multilevel, mixed-effects). It assumes the regression coefficient is for a dummy code reflecting the contrast between the treatment and control conditions. This method is unsuitable for a regression coefficient associated with a scaled independent variable. It also assumes that this is a linear model (i.e., not a logistic, Poisson, negative-binomial, etc., type model). These models account for clustering effects, such as students clustered within classrooms. Following What Works Clearinghouse recommendations, an ICC of 0.20 is assumed if it is unknown. Two methods of estimating the standard error and variance are provided. The first is based on the standard error of the regression coefficient and ensures that the \(p\)-value for the effect size is consistent with the \(p\)-value for the regression coefficient. The second is based on the effect size and sample size using the canonical equation for the standard error of Cohen’s \(d\) and Hedges’ \(g\), adjusted for the ICC. In most cases, the first method is preferred as it accounts for the covariates in the regression model.

Cohen’s \(d\) is computed as \[ d = \left(\frac{B}{s_{pooled}}\right) \sqrt{\lambda} ~, \] where \(s_y\) is the standard deviation of the dependent variable, \(B\) is the unstandardized regression coefficient, \(s_{pooled}\) is \[ s_{pooled} = \sqrt{ \frac{s_y^2[(n_1+n_2) - 1] - \left( \frac{B^2(n_1*n_2)} {(n_1+n_2)} \right)}{n_1+n_2-2} } ~, \] and \(\lambda\) is \[ \lambda = 1 - \frac{2(\frac{n}{m})p}{n - 1} ~. \] The \(p\) in the above equation is the intra-class correlation (ICC).

The small sample size bias correction for Hedges’ \(g\) incorporates the intra-class correlation (\(p\)), the total sample size (\(n\)), and the number of clusters (\(m\)). It is computed as \[ j = 1 - \left( \frac{3}{4h-1} \right), \] where \(h\) is \[ h =\frac{\left[ (n - 2)-2\left(\frac{n}{m}-1\right)p\right]^2}{(n-2)(1-p)^2+\frac{n}{m}\left(n-2\frac{n}{m}\right)p^2 + 2\left(n-2\frac{n}{m}\right)p(1-p)} ~. \]

Hedges’ \(g\) is computed as \[ g = j \cdot d \cdot \sqrt{\lambda} ~. \]

The standard error and variance of these effect sizes can be computed either from the effect size and sample sizes or from the standard error associated with \(B\) (\(s_B\)). The latter takes into account covariates incorporated into the model. The variance for Cohen’s \(d\) and Hedges’ \(g\) based on the effect size and sample sizes are \[ v_d = \left(\frac{n_1 + n_2}{n_1n_2}\right)\left[1+(n-1)p\right]+\left( \frac{d^2}{2h}\right) ~, \] and \[ v_g = j^2 \left(\frac{n_1 + n_2}{n_1n_2}\right)\left[1+(n-1)p\right]+\left( \frac{g^2}{2h}\right) ~. \]

The variance for Cohen’s \(d\) and Hedges’ \(g\) based on the standard error (\(s_B\)) are \[ v_d = \lambda \left(\frac{s_B}{s_{pooled}}\right)^2 + \frac{d^2}{2h} ~, \] and \[ v_g = j^2 \lambda \left(\frac{s_B}{s_{pooled}}\right)^2 + \frac{g^2}{2h} ~. \]

2 The Odds Ratio and Risk Ratio

The odds ratio and risk ratio are suitable for meta-analyses where both the independent variable and the dependent variable are binary. In the case of a non-dichotomous dependent variable, the odds ratio (but not the risk ratio) can be approximated by first computing Cohen’s \(d\) and then converting it into an odds ratio using either the logit or Cox logit method.

2.1 Odds ratio and risk ratio from 2-by-2 contingency table

A 2-by-2 contingency tables reflects the relationship between a binary independent variable (such as treatment vs. control) and a binary dependent variable (such as success or failure on some outcome). It is customary to label the cells of this table as \(a\), \(b\), \(c\), and \(d\), where \(a\) is the frequency of successes in the treatment condition, \(b\) is the frequency of failures in the treatment condition, \(c\) is the frequency of successes in the control condition, and \(d\) is the frequency of failures in the control condition. Using these frequencies, we can compute the following: \[ \textrm{Odds ratio} = \textrm{OR} = \frac{a \cdot d}{b \cdot c} ~, \] \[ \textrm{logged}_{\textrm{OR}} = \textrm{log} \left( OR \right) ~, \] \[ \textrm{Risk ratio} = \textrm{RR} = \frac{a/(a+b)}{c/(c+d)} ~, \] \[ \textrm{logged}_{\textrm{RR}} = \textrm{log} \left( RR \right) ~, \] \[ v_{\textrm{logged}_\textrm{OR}} = \frac{1}{a} + \frac{1}{b} + \frac{1}{c} + \frac{1}{d} ~, \] and \[ v_{\textrm{logged}_\textrm{RR}} = \frac{b/a}{a+b} + \frac{d/c}{c+d} ~. \]

If \(a\), \(b\), \(c\), or \(d\) equals zero, \(0.5\) is added to all four cells.

2.2 Odds ratio and risk ratio from proportions

The odds ratio and risk ratio can be computed directly from proportions. The variance of each requires knowledge of the corresponding sample sizes. The equations are below.

\[ \textrm{OR} = \frac{p_1/(1-p_1)}{p_2/(1-p_2)} = \frac{p_1(1-p_2)}{p_2(1-p_1)} ~. \] \[ \textrm{logged}_{\textrm{OR}} = \textrm{log} \left( OR \right) ~, \] \[ \textrm{RR} = \frac{p_1}{p_2} ~, \] \[ \textrm{logged}_{\textrm{RR}} = \textrm{log} \left( RR \right) ~, \] \[ v_{\textrm{logged}_\textrm{OR}} = \frac{1}{n_1p_1} + \frac{1}{n_1(1-p_1)} + \frac{1}{n_2p_2} + \frac{1}{n_2(1-p_2)} ~, \] and \[ v_{\textrm{logged}_\textrm{RR}} = \frac{(1-p_1)/p_1}{n_1} + \frac{(1-p_2)/p_2}{n_2} ~. \]

If either \(p_1\) or \(p_2\) equals 0, then both are adjusted as \[ p = p + \frac{.5}{n} ~. \] If either \(p_1\) or \(p_2\) equals 1, then both are adjusted as \[ p = p - \frac{.5}{n} ~. \]

2.3 Odds ratio and risk ratio from percents

Recall that percents are simply proportions multiplied by 100. Thus, this method converts percents (with a range between 0 and 100, inclusively) into percents (with a range between 0 and 10, inclusively) by dividing by 100. The method of computing the odds and risk ratios from proportions is then used.

2.4 Odds ratio and risk ratio from Cohen’s \(d\)

There may be situations where you want to compute an odds ratio from data better suited to Cohen’s \(d\). To do so, first compute Cohen’s \(d\) using the appropriate method under the “Cohen’s d & Hedges g” menu. Then use this method to convert Cohen’s \(d\) and its associated standard error (\(se_d\)) into an odds ratio. Two methods are provided, the logit method and the Cox logit method. They generally provide fairly similar results. The equations for these conversions are shown below: \[ \textrm{logged}_{{\textrm{OR}}_{logit}} = d \cdot \frac{\pi}{\sqrt{3}} ~, \] \[ \textrm{logged}_{{\textrm{OR}}_{Cox}} = d \cdot 1.65 ~, \] \[ v_{\textrm{logged}_{{\textrm{OR}}_{logit}}} = v_d \cdot \frac{\pi^2}{3} ~, \] and \[ v_{\textrm{logged}_{{\textrm{OR}}_{Cox}}} = v_d \cdot 1.65^2 ~. \]

2.5 Odds ratio from 2-by-2 frequency data with pretest data

This method computes the odds ratio from 2-by-2 frequency data adjusted for baseline differences on the outcome variable (i.e., pretest 2-by-2 frequency data). Study authors rarely report the pretest/post-test correlation. Fortunately, this correlation is unneeded for computing the baseline adjusted effect size. However, the correlation does affect the standard error and variance. For a robust standard error estimator, set the correlation to 0 (this reproduces the standard error for the treatment effect from a difference-in-differences GEE logistic regression model).

The method is straightforward and simply subtracts the pretest logged odds ratio from the post-test logged odds ratio, producing a difference-in-differences estimate (\(DiD\)) of the treatment effect. This is shown below \[ \textrm{logged}_{{\textrm{OR}}_{DiD}} = \textrm{logged}_{{\textrm{OR}}_{post-test}} - \textrm{logged}_{{\textrm{OR}}_{pretest}} ~, \] where the logged odds ratio is computed as shown under “Odds ratio and risk ratio from 2-by-2 frequency data”.

The variances takes into account the covariance between pretest and post-test based on the provided pretest/post-test correlation (\(r\)). The equation is \[ {v}_{\textrm{logged}_\textrm{OR}} = {v}_{{\textrm{logged}_\textrm{OR}}_{post-test}} + {v}_{{\textrm{logged}_\textrm{OR}}_{pretest}} - 2(r \cdot {v}_{{\textrm{logged}_\textrm{OR}}_{post-test}} \cdot {v}_{{\textrm{logged}_\textrm{OR}}_{pretest}}) \]

3 The Correlation Coefficient \(r\)

The correlation coefficient (\(r\)) is a widely used effect size in meta-analysis. It is well-suited to observational studies where the effect of interest is the linear relationship between two scaled or continuous constructs. Typically, meta-analysts convert correlations into Fisher’s \(Z_r\) for analysis and then back transform final results, such as converting the meta-analytic mean \(Z_r\) into an \(r\). This accomplishes two things: \(Z_r\) is unbounded whereas \(r\) is bounded between \(-1\) and \(+1\), and \(Z_r\) has a well defined standard error whereas \(r\) does not.

The first method below performs the Fisher’s \(Z_r\) transformation based on a correlation coefficient and sample size. The remaining methods are for situations where the correlation coefficient might not be provided by the study authors but other usable information might be, such as the \(p\)-value for a correlation.

3.1 Correlation and sample size (Fisher’s \(Z_r\) transformation)

This method applies Fisher’s \(Z_r\) transformation to a correlation. \[ Z_r = \left( \frac{1}{2} \right) \textrm{log} \left( \frac{1+r}{1-r} \right) \]

The variance and standard error of \(Z_r\) are \[ v_{Z_r} = \frac{1}{n - 3} ~, \] and \[ se_{Z_r} = \sqrt{\frac{1}{n -3}} ~, \] where \(n\) is the total sample size.

The 95% confidence intervals are computed as \[ {Z_r}_{lower} = \overline{Z}_r - z \cdot se_{Z_r}, \\ {Z_r}_{upper} = \overline{Z}_r + z \cdot se_{Z_r} ~, \] where \(z\) is the two-tailed critical value for \(\alpha = .05\), or 1.959964.

A mean \(Z_r\) and associated confident limits can be back transformed into correlations (\(r\)) using the following function: \[ r = \frac{e^{2 \cdot Z_r}-1}{e^{2 \cdot Z_r}+1} ~. \]

3.2 Correlation from a \(j\) by \(k\) frequency table (two ordinal variables)

Before computers were widely used to compute statistics there were computationally efficient methods of computing common statistics, such as Pearson’s correlation coefficient, from a contingency table, rather than the raw data. This method can be used to compute a correlation from a contingency table (a \(j\) by \(k\) frequency table, where \(j\) is the number of rows and \(k\) is the number of columns). This method assumes that each variable is at least ordinal and that the table maintains the ordered nature of the data. The correlation is computed as \[ r = \frac{n \sum f_{jk} - f_{jk} \cdot j \cdot f_{jk} \cdot k } {\sqrt{ \left[ n \sum f_{jk} \cdot j^2 - \left( \sum f_{jk} \cdot j \right)^2 \right] \left[ n \sum f_{jk} \cdot k^2 - \left( \sum f_{jk} \cdot k \right)^2 \right] }} ~, \] where \(f_{jk}\) represents the frequency for rows and \(j\) and column \(k\), \(j\) is the number of rows, \(k\) is the number of columns, and \(n\) is the sample size or sum of the frequencies.

Fisher’s \(Z_r\) and associated statistics are computed as shown for the method for correlations and sample sizes.

3.3 Correlation from means and standard deviations

This method first computes Cohen’s \(d\) from the means, standard deviations, and sample sizes. The result is converted into \(r\) using \[ r = \frac{d}{\sqrt{d^2 + \frac{1}{p(1-p)}}} ~, \] where \(p\) is \[ p = \frac{n_1}{n_1+n_2} ~. \]

When \(n_1\) and \(n_2\) are equal, the above simplifies to \[ d = \frac{d}{\sqrt{d^2 + 4}} ~. \] Note that this computes the point-biserial correlation. It is also equivalent to a Pearson’s \(r\) computed between the scaled dependent variable and a dummy coded independent variable (indicator variable for group).

Fisher’s \(Z_r\) transformation is applied to the above \(r\). The variance and standard error of \(Z_r\) are computed as with the correlation and sample size.

3.4 Correlation from a 2-by-2 frequency table

The correlation coefficient (a phi coefficient in this case) is computed from 2-by-2 frequency data as \[ r = \frac{a \cdot d - b \cdot c}{\sqrt{(a+b)(c+d)(a+c)(b+d)}} ~, \] where \(a\), \(b\), \(c\), and \(d\) are the cell frequencies of the 2-by-2 contingency table.

The result is transformed to \(Z_r\) as usual. However, the variance of \(Z_r\) is based on the variance of the logged odds ratio. This is re-scaled to produce the same ratio of \(Z_r\) to \(se_{Z_r}\) as for the logged OR and its standard error: \[ v_{\textrm{logged}_\textrm{OR}} = \frac{1}{a} + \frac{1}{b} + \frac{1}{c} + \frac{1}{d} ~, \] and \[ v_{Z_r} = \frac{Z_r^2}{\textrm{logged}_{\textrm{OR}}^2 \cdot v_{\textrm{logged}_\textrm{OR}}} ~. \]

3.5 Correlation from a chi-square based on a 2-by-2 frequency table

This method computes a correlation from a chi-square calculated on 2-by-2 frequency data. The degrees of freedom for the chi-square must equal 1. It assumes you have two groups or conditions and a binary dependent variable. The “Yes” and “No” are simply the two levels of the binary variable, such as yes/no, success/failure, passed/failed, lived/died, etc. The correlation is computed as \[ r = \sqrt{\frac{\chi^2}{n}} ~, \] where \(n\) is the total sample size or sum of the 2-by-2 frequencies. Fisher’s \(Z_r\) and variance are computed as with the correlation and sample size case.

3.6 Correlation from chi-square \(p\)-value based on a 2-by-2 frequency table

The chi-square associated with an exact \(p\)-value and associated degrees of freedom can be determined using the inverse probability distribution for the chi-square. This method uses a Javascript function for this written by John C. Pezzullo. You can reproduce these result using the functions built into R, Stata, SPSS, or Excel, as shown below.

* R: qchisq(1-p,df)
* Stata: invchi2(df,1-p)
* SPSS: idf.ch2(1-p,df)
* Excel: CHISQ.INV(1-p,df)

A chi-square from a 2-by-2 frequency table will always have 1 degree of freedom. This method determines the chi-square from the \(p\)-value and then proceeds as with the method for chi-squares.

3.7 Correlation from a \(t\)-test

This method calculates a correlation from a \(t\)-test. The method assumes that the \(t\)-value is either (1) associated with a correlation coefficient, or (2) is testing the difference between two independent means. The correlation is computed as \[ r = \frac{t}{\sqrt{t^2 + n - 2}} \] Fisher’s \(Z_r\) and variance are computed as with the correlation and sample size case.

3.8 Correlation from a \(p\)-value from a \(t\)-test

This method calculates a correlation from a \(p\)-value from a \(t\)-test. The method assumes that the \(t\)-test is either (1) associated with a correlation coefficient, or (2) is testing the difference between two independent means.

This calculator uses Javascript inverse distribution functions written by John C. Pezzullo. The equations are iterative and are not reproduced here. However, inverse distribution functions are built into most statistical software packages. Below are examples of how to obtain a \(t\)-value from a \(p\)-value and associated df with R, Stata, SPSS, and Excel. In all cases it is assumed that these are two-tailed \(p\)-values.

* R: abs(qt(p/2,df))
* Stata: abs(invt(df,p/2))
* SPSS: abs(idf.t(p/2,df))
* Excel: INVT(p,df)

Once the \(t\)-value associated with the \(p\)-value is determined, the method for determining \(r\) and \(Z_r\) from a \(t\)-value is used.