LukasWallrich / metaUI

Create shiny apps that allow explore of meta-analysis results
https://lukaswallrich.github.io/metaUI/
GNU General Public License v3.0
5 stars 0 forks source link

Figure out sign for p-curve effect estimate #13

Open LukasWallrich opened 1 year ago

LukasRoeseler commented 1 year ago

Apart from requiring no sign for the test statistics, the p-curve function estimates absolute effect sizes only. We might want the sign to match that from one of the other methods.

Below is the section from Matthias Harrer's function (dmetar package, https://raw.githubusercontent.com/MathiasHarrer/dmetar/master/R/pcurve2.R):

Define ci.to.t function

ci.to.t = function(TE, lower, upper, n){

  z.to.d = function(z, n){
    d = (2*z)/sqrt(n)
    return(abs(d))
  }

  ci.to.p = function(est, lower, upper){
    SE = (upper-lower)/(2*1.96)
    z = abs(est/SE)
    p = exp(-0.717*z - 0.416*z^2)
    return(p)
  }

  d.to.t = function(d, n){
    df = n-2
    t = (d*sqrt(df))/2
    return(t)
  }

  p = ci.to.p(TE, lower, upper)
  z = abs(qnorm(p/2))
  d = z.to.d(z, n)
  t = d.to.t(d, n)

  return(t)
LukasWallrich commented 1 year ago

@LukasRoeseler thanks - reopening this because I need to implement it.

Also, do I understand correctly that this returns Cohen's d? Does this make any sense if you are meta-analyzing different ESs, e.g., ORs?

LukasRoeseler commented 1 year ago

@LukasWallrich we could convert the output to a target effect size but at this point I am not sure whether we should rather drop p-curve. Let me know if I should prepare code to convert the p-curve effect size estimate.

LukasWallrich commented 1 year ago

In my example dataset, Barroso et al., the effect size is given as Fisher's z which should be similar to d - but the p-curve effect size estimate is twice as large as all others - so I am not sure whether I trust this, and to generalise the ES conversion might be rather difficult ... so I removed these estimates for now.