metafor icon indicating copy to clipboard operation
metafor copied to clipboard

Error (?) in SMDH calculation

Open pdudgeon opened this issue 1 year ago • 1 comments

Bug Report

In the calculation of SMDH in escalc.R (Line 901 in version 3.8-1)

          yi <- cmi * (m1i - m2i) / si

yi is corrected for upward bias.

Further below on Line 906 in the calculation of the variance of yi

           ### note: Bonett (2009) plugs in the uncorrected yi into the
           ### equation for vi; here, the corrected value is plugged in
           vi <- yi^2 * (sd1i^4 / (n1i-1) + ....
           vi <- cmi^2 * vi

the initial vi term is subsequently multiplied by the square of the correction factor in the line following.

This additional multiplication by cmi^2 seems unnecessary (unless I am missing something).

I note that this same additional multiplication expression on Line 919 in the calculation of SMD1H has been commented out.

Thanks in advance.

Paul Dudgeon

pdudgeon avatar Sep 05 '22 05:09 pdudgeon

This is in principle correct, since Var[c*x] = c^2 * Var[x] for some constant c. Sometimes, this is left out, since the typical equations used for computing (or rather: estimating) the sampling variance of d-type outcome measures are based on asymptotic approximations and asymptotically the bias correction factor would be 1 anyway. In fact, there are all kinds of variations that can arise in those variance equations, for example depending on whether we plug the biased or unbiased estimate of the d-value into the equation and/or whether we turn 'n-1' terms into just 'n' (per group). Again, asymptotically none of this matters and if group sizes are at least moderately large (for some definition of 'moderately'), differences between these variations are negligible. If, on the other hand, sample sizes are small, then one could argue that none of the typical equations are appropriate, since they are based on asymptotic approximations. For some measures (like "SMD"), one can use the equation that provides an unbiased estimate of the sampling variance (that is unbiased even if group sizes are very small), but everything should be treated with great caution anyway under such circumstances.

wviechtb avatar Sep 05 '22 09:09 wviechtb